mirror of
https://github.com/turtlebasket/comrade-bot.git
synced 2026-03-04 19:44:27 -08:00
fix & improve emote voting
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -107,4 +107,5 @@ venv.bak/
|
||||
.vscode/
|
||||
|
||||
# muh token is stored as plain text ehehehehe
|
||||
token.txt
|
||||
token.txt
|
||||
config.json
|
||||
|
||||
11
bot.py
11
bot.py
@@ -106,11 +106,14 @@ async def addEmote(ctx, emote_name: str):
|
||||
|
||||
vote_passed = await take_vote(ctx, "Add emoji `{}`?".format(emote_name), EMOTE_VOTE_TIME, MIN_EMOTE_VOTERS)
|
||||
|
||||
# if all_in_favor > not_in_favor and all_in_favor > MIN_EMOTE_VOTERS:
|
||||
await ctx.send(embed=imgfun(msg, url))
|
||||
if vote_passed:
|
||||
file_bytes = await ctx.message.attachments[0].read()
|
||||
await ctx.guild.create_custom_emoji(name=emote_name, image=file_bytes)
|
||||
try:
|
||||
file_bytes = await ctx.message.attachments[0].read()
|
||||
await ctx.guild.create_custom_emoji(name=emote_name, image=file_bytes)
|
||||
await ctx.send("`Emote {0} added!` :{0}:".format(emote_name))
|
||||
except:
|
||||
await ctx.send(":warning: `There was an error adding emote {}.`".format(emote_name))
|
||||
|
||||
|
||||
@bot.command()
|
||||
async def shibe(ctx):
|
||||
|
||||
Reference in New Issue
Block a user