async def avatar(self, ctx, user: discord.Member = None): if user == None: user = ctx.author e = discord.Embed(title=f'Avatar for {user}', description=f'[Direct Link]({user.avatar_url})') e.set_image(url=user.avatar_url) footera(e) await ctx.send(embed=e)
async def triggered(self, ctx, *, args: discord.Member = None): if args == None: args = ctx.author e = discord.Embed(color=emcolor) footera(e) e.set_image( url= f"https://some-random-api.ml/canvas/triggered?avatar={args.avatar_url_as(format='jpg', size=256)}" ) await ctx.send(embed=e)
async def gay(self, ctx, *, args: discord.Member = 'None'): await ctx.trigger_typing() if args == 'None': args = ctx.author avatar = args.avatar_url_as(format='jpg', size=256) embed = discord.Embed(color=emcolor, timestamp=timei.now) embed.set_image( url=f"https://some-random-api.ml/canvas/gay?avatar={avatar}") footera(embed) await ctx.send(embed=embed)
async def fetchavatar(self, ctx, id_: int = None): if id_ == None: await ctx.send( f"You need to provide someone to fetch their avatar.\nUsage: `{prefix(ctx.message)}fetchav [user-id]`" ) return user = await self.bot.fetch_user(id_) e = discord.Embed(title=f'Avatar for {user}', description=f'[Direct Link]({user.avatar_url})') e.set_image(url=user.avatar_url) footera(e) await ctx.send(embed=e)
async def youtubecomment(self, ctx, *, args): await ctx.trigger_typing() a = args.split(' ') b = '+'.join(a) c = ctx.author.avatar_url_as(format='jpg') e = ctx.author.name.split(' ') d = '+'.join(e) #Image.open(BytesIO(await f'https://some-random-api.ml/canvas/youtube-comment?username={d}&avatar={c}&comment={b}'.read())).save(f'{ctx.message.id}.png') embed = discord.Embed(title=f'{ctx.author.name} Commented!', color=emcolor) footera(embed) embed.set_image( url= f'https://some-random-api.ml/canvas/youtube-comment?username={d}&avatar={c}&comment={b}' ) await ctx.send(embed=embed)
async def tweet(self, ctx, *, message: str): await ctx.trigger_typing() a = message.split(' ') msg = '+'.join(a) e = ctx.author.name.split(' ') username = '******'.join(e) async with aiohttp.ClientSession() as cs: async with cs.get( f"https://nekobot.xyz/api/imagegen?type=tweet&username={username}&text={msg}" ) as r: res = await r.json() em = discord.Embed(title=f'{ctx.author.name} Tweeted!', color=emcolor, timestamp=timei.now) em.set_image(url=res["message"]) footera(em) await ctx.send(embed=em)
async def messages(self, ctx, user: discord.Member = 'self'): if user == 'self': user = ctx.author thing = 0 try: for channel in ctx.guild.text_channels: async for thing2 in channel.history(limit=None): if thing2.author == user: thing = thing + 1 except Exception as er: print(er) e = discord.Embed( description= f'{user.mention} has `{len(thing)}` total messages.\nNote: The counter only counts the last 25000 messages.', color=emcolor) footera(e) await ctx.send(embed=e)
async def embed(self, ctx, *, args=None): if args == None: return await ctx.send( f"You need to provide something to transform.\nUsage: `{prefix(ctx.message)}embed [query]`" ) else: argsplit = args.split("|") if "|" in ctx.message.content: title = argsplit[0] desc = argsplit[1] embed = discord.Embed(title=title, description=desc, colour=emcolor) else: title = args embed = discord.Embed(title=title, colour=emcolor) footera(embed) await ctx.send(embed=embed)
async def invites(self, ctx, user: discord.Member = 'self'): if user == 'self': user = ctx.author total = 0 for i in await ctx.guild.invites(): if i.inviter == user: total += i.uses def thing(c: int): if c == 1: return 'user' else: return 'users' e = discord.Embed( description=f'{user.mention} has invited {total} {thing(total)}.', color=emcolor) footera(e) await ctx.send(embed=e)