adding meme. fixes #19
This commit is contained in:
parent
a18a999eb9
commit
385f132a53
31
app/bot.py
31
app/bot.py
@ -132,13 +132,14 @@ async def emoji(ctx):
|
||||
|
||||
import core_utils
|
||||
emoji_staging = '/tmp/emoji'
|
||||
await ctx.send("emoji successfully uploaded! Heres how it looks in a sentence {}\nUse it with `:{}:`".format(
|
||||
await ctx.message.guild.create_custom_emoji(
|
||||
name=emoji_name,
|
||||
image=open(core_utils.download_image(url, emoji_staging), "rb").read()
|
||||
), emoji_name
|
||||
try:
|
||||
await ctx.send("emoji successfully uploaded! Heres how it looks in a sentence {}\nUse it with `:{}:`".format(
|
||||
await ctx.message.guild.create_custom_emoji(
|
||||
name=emoji_name,
|
||||
image=open(core_utils.download_image(url, emoji_staging), "rb").read()
|
||||
), emoji_name
|
||||
)
|
||||
)
|
||||
)
|
||||
except Exception:
|
||||
await ctx.send(
|
||||
"I wasnt able to upload that image as an emoji. Sorry"
|
||||
@ -155,14 +156,28 @@ async def avatar(ctx):
|
||||
# Code stolen from this reddit post
|
||||
# https://www.reddit.com/r/discordapp/comments/74bb4z/retrieve_a_mentioned_users_avatar_using_discordpy
|
||||
for user in profile:
|
||||
avatar_url = str(user.avatar_url).replace('.webp', '.png')
|
||||
await ctx.send(
|
||||
embed=generate_embed(
|
||||
embed_title="{}#{}".format(user.name, user.discriminator),
|
||||
embed_url=str(user.avatar_url).replace('.webp', '.png'),
|
||||
embed_description="[Direct Link]({})".format(str(user.avatar_url).replace('.webp', '.png'))
|
||||
embed_url=avatar_url,
|
||||
embed_description="[Direct Link]({})".format(avatar_url)
|
||||
)
|
||||
)
|
||||
|
||||
@bot.command(name='meme')
|
||||
async def meme(ctx):
|
||||
|
||||
import meme_gen
|
||||
await ctx.message.delete()
|
||||
await ctx.send(
|
||||
embed=generate_embed(
|
||||
embed_url=meme_gen.parse_message(
|
||||
ctx.message.content
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@bot.command(name='redpanda')
|
||||
async def redpanda(ctx):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user