fix(antipolls): use append instead of extend
This commit is contained in:
parent
602d759e67
commit
4f38fc1f7d
1 changed files with 6 additions and 6 deletions
|
@ -96,9 +96,9 @@ class AntiPolls(commands.Cog):
|
|||
failed: list[discord.Role] = []
|
||||
for role in roles:
|
||||
if role.id in role_whitelist:
|
||||
failed.extend(role)
|
||||
failed.append(role)
|
||||
continue
|
||||
role_whitelist.extend(role.id)
|
||||
role_whitelist.append(role.id)
|
||||
await ctx.tick()
|
||||
if failed:
|
||||
await ctx.send(f"The following roles were already in the whitelist: {humanize_list(role.mention for role in failed)}", delete_after=10, allowed_mentions=discord.AllowedMentions.none)
|
||||
|
@ -111,7 +111,7 @@ class AntiPolls(commands.Cog):
|
|||
failed: list[discord.Role] = []
|
||||
for role in roles:
|
||||
if role.id not in role_whitelist:
|
||||
failed.extend(role)
|
||||
failed.append(role)
|
||||
continue
|
||||
role_whitelist.remove(role.id)
|
||||
await ctx.tick()
|
||||
|
@ -139,9 +139,9 @@ class AntiPolls(commands.Cog):
|
|||
failed: list[discord.TextChannel] = []
|
||||
for channel in channels:
|
||||
if channel.id in channel_whitelist:
|
||||
failed.extend(channel)
|
||||
failed.append(channel)
|
||||
continue
|
||||
channel_whitelist.extend(channel.id)
|
||||
channel_whitelist.append(channel.id)
|
||||
await ctx.tick()
|
||||
if failed:
|
||||
await ctx.send(f"The following channels were already in the whitelist: {humanize_list(channel.mention for channel in failed)}", delete_after=10, allowed_mentions=discord.AllowedMentions.none)
|
||||
|
@ -154,7 +154,7 @@ class AntiPolls(commands.Cog):
|
|||
failed: list[discord.TextChannel] = []
|
||||
for channel in channels:
|
||||
if channel.id not in channel_whitelist:
|
||||
failed.extend(channel)
|
||||
failed.append(channel)
|
||||
continue
|
||||
channel_whitelist.remove(channel.id)
|
||||
await ctx.tick()
|
||||
|
|
Loading…
Reference in a new issue