Skip to content

Commit b4efbb4

Browse files
authored
BUGFIX
Update of persistent reports might not work on special channels
1 parent 7ed0463 commit b4efbb4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

services/bot/dcsserverbot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,7 @@ async def setEmbed(self, *, embed_name: str, embed: discord.Embed, channel_id: U
483483
self.log.exception(ex)
484484
return
485485
if not row or not message:
486-
if channel.type == discord.ChannelType.text:
487-
message = await channel.send(embed=embed, file=file)
488-
thread = None
489-
else:
486+
if channel.type == discord.ChannelType.forum:
490487
for thread in channel.threads:
491488
if thread.name.startswith(server.name):
492489
message = await thread.send(embed=embed, file=file)
@@ -496,6 +493,9 @@ async def setEmbed(self, *, embed_name: str, embed: discord.Embed, channel_id: U
496493
embed=embed, file=file)
497494
message = thread.message
498495
thread = thread.thread
496+
else:
497+
message = await channel.send(embed=embed, file=file)
498+
thread = None
499499
async with self.apool.connection() as conn:
500500
async with conn.transaction():
501501
await conn.execute("""

0 commit comments

Comments
 (0)