Skip to content

Commit 8086209

Browse files
committed
fix incorrect emote name
1 parent 0c1347f commit 8086209

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cogs/stealemote.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ async def fetch(emote_id: str):
8181
async with session.get(base_url + emote_id) as response:
8282
if response.status != 200:
8383
return None
84-
return await response.read()
84+
return await response.read(), emote_id
8585

86-
results: list[bytes | None] = await asyncio.gather(
86+
results: list[tuple[bytes, str] | None] = await asyncio.gather(
8787
*[fetch(emote) for emote in emote_ids]
8888
)
89-
results: list[bytes] = [result for result in results if result]
89+
results: list[tuple[bytes, str]] = [result for result in results if result]
9090
if len(results) == 0:
9191
await ctx.reply("No *valid* emotes found in the message.")
9292
raise commands.errors.BadArgument()
@@ -107,15 +107,15 @@ async def fetch(emote_id: str):
107107
)
108108
continue
109109

110-
for result in results:
111-
if result in added:
110+
for image, emote_id in results:
111+
if image in added:
112112
continue
113113
try:
114114
emoji = await guild.create_custom_emoji(
115-
name=emote_names[emote_id], image=result
115+
name=emote_names[emote_id], image=image
116116
)
117117
success.append(f"{guild_id}: Success: {str(emoji)}")
118-
added.append(result)
118+
added.append(image)
119119
except discord.Forbidden:
120120
errors.append(
121121
f"{guild_id}: Missing permissions (`{emote_names[emote_id]}`)"

0 commit comments

Comments
 (0)