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