Make emoji send a nice embed on emoji creation, or send the actual error as a message if it fails
This commit is contained in:
parent
4c17d74a41
commit
ebb606adfc
@ -1,6 +1,7 @@
|
||||
from discord.ext import commands
|
||||
import discord
|
||||
import os
|
||||
import core_utils
|
||||
|
||||
|
||||
class ServerUtils(commands.Cog):
|
||||
@ -52,11 +53,14 @@ class ServerUtils(commands.Cog):
|
||||
image=open(emoji_staging, "rb").read(),
|
||||
)
|
||||
await ctx.send(
|
||||
"Emoji created! heres how it looks in a sentence\n\n%s" % emoji_id
|
||||
embed=core_utils.generate_embed(
|
||||
embed_title="New emoji: %s" % emoji_name,
|
||||
embed_description=emoji_id,
|
||||
)
|
||||
)
|
||||
except Exception as e:
|
||||
await ctx.send(
|
||||
"I wasnt able to upload that image as an emoji. Sorry\n %s" % e
|
||||
"I wasnt able to upload that image as an emoji. Sorry\n\nError: %s" % e
|
||||
)
|
||||
os.remove(emoji_staging)
|
||||
return
|
||||
|
@ -6,7 +6,7 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "203"
|
||||
tag: "204"
|
||||
repository: ldooks/dragon-bot
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user