Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

Commit ed78ebd

Browse files
committed
Update dependencies
1 parent 28cea40 commit ed78ebd

File tree

4 files changed

+119
-797
lines changed

4 files changed

+119
-797
lines changed

general/betheprofessional/cog.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ async def parse_topics(guild: Guild, topics: str, author: Member) -> List[Role]:
3939
raise CommandError(t.youre_not_the_first_one(topic, author.mention))
4040
else:
4141
if all_topics:
42-
43-
def dist(name: str) -> int:
44-
return calculate_edit_distance(name.lower(), topic.lower())
45-
46-
best_dist, best_match = min((dist(r.name), r.name) for r in all_topics)
42+
best_dist, best_match = min(
43+
(calculate_edit_distance(r.name.lower(), topic.lower()), r.name) for r in all_topics
44+
)
4745
if best_dist <= 5:
4846
raise CommandError(t.topic_not_found_did_you_mean(topic, best_match))
4947

general/custom_commands/cog.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ async def send_custom_command_message(
103103
for embed_data in msg.get("embeds") or [None]:
104104
embed = None
105105
if embed_data is not None:
106-
embed: Embed = type("", (), {"to_dict": lambda _: embed_data})()
106+
embed: Embed = type("", (), {"to_dict": lambda _, d=embed_data: d})()
107107
elif not content:
108108
if test:
109109
await reply(ctx, embed=warning(t.empty_message(ctx.prefix, custom_command.name)))
110110
break
111111

112-
async def _send_message():
112+
async def _send_message(content=content, embed=embed):
113113
if test:
114114
allowed_mentions = AllowedMentions(everyone=False, users=False, roles=False)
115115
await reply(ctx, content, embed=embed, allowed_mentions=allowed_mentions)
@@ -119,9 +119,9 @@ async def _send_message():
119119
else:
120120
await reply(ctx, content, embed=embed)
121121
else:
122-
msg = await channel.send(content, embed=embed)
122+
m = await channel.send(content, embed=embed)
123123
if not custom_command.delete_command:
124-
await link_response(ctx, msg)
124+
await link_response(ctx, m)
125125
await add_reactions(ctx, "white_check_mark")
126126

127127
try:

0 commit comments

Comments
 (0)