Skip to content

Commit ed008ea

Browse files
fix potential duplicate tags (#29)
1 parent 4c09e55 commit ed008ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/help.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@ async def solved(self, ctx: core.GuildContext) -> None:
128128
if not tag:
129129
return
130130

131+
tags = ctx.channel.applied_tags
132+
if not any(tag_.id == 1006769269201195059 for tag_ in tags):
133+
tags.append(tag)
134+
131135
await ctx.channel.edit(
132136
locked=True,
133137
archived=True,
134-
applied_tags=ctx.channel.applied_tags + [tag],
138+
applied_tags=tags[:5],
135139
reason=f"Marked as solved by {ctx.author}",
136140
)
137141

0 commit comments

Comments
 (0)