示例#1
0
 async def inspirobot(self, ctx):
     async with aiohttp.ClientSession() as session:
         async with session.get(f"https://inspirobot.me/api?generate=true"
                                ) as inspirobotraw:
             url = (str(await inspirobotraw.read()).split("'"))[1]
         embed = embeds.imgembed("An inspirational quote!", url, url)
         await ctx.send(embed=embed)
示例#2
0
 async def blur(self,
                ctx,
                user: typing.Optional[discord.User],
                *,
                argument: str = None):
     async with ctx.channel.typing():
         bytes_to_give = await self.convert_to_bytes_better(
             user, argument, ctx)
         buy_one_and_get_one_free = await self.bot.loop.run_in_executor(
             None, partial(image_processors.blur_processor, bytes_to_give))
     file = discord.File(filename="blur.png", fp=buy_one_and_get_one_free)
     embed = embeds.imgembed("Blurred!", "attachment://blur.png")
     await ctx.send(file=file, embed=embed)
示例#3
0
 async def yesorno(self, ctx):
     async with aiohttp.ClientSession() as session:
         async with session.get(f"https://yesno.wtf/api") as rawversion:
             yes_or_no_api = await rawversion.json()
     if yes_or_no_api['answer'] == "yes":
         emoji = self.bot.get_emoji(797916243281707008)
     elif yes_or_no_api['answer'] == "no":
         emoji = self.bot.get_emoji(797916257558331432)
     elif yes_or_no_api['answer'] == "maybe":
         emoji = self.bot.get_emoji(798298058495361025)
     embed = embeds.imgembed(
         f"{emoji} {str(yes_or_no_api['answer']).title()}.",
         yes_or_no_api['image'])
     await ctx.send(embed=embed)
示例#4
0
文件: fun.py 项目: fossabot/Compass-2
 async def screenshot(self, ctx, *, url: str):
     await ctx.send(embed=embeds.imgembed(
         "Website screenshotted!",
         f"https://image.thum.io/get/width/1920/crop/675/maxAge/1/noanimate/{url}"
     ))
示例#5
0
文件: fun.py 项目: fossabot/Compass-2
 async def tablist(self, ctx):
     embed = embeds.imgembed("Your tablist!", "https://tab.2b2t.dev/")
     await ctx.send(embed=embed)