Update
This commit is contained in:
parent
9e8a12f360
commit
3435502103
1 changed files with 13 additions and 0 deletions
13
misc.py
13
misc.py
|
@ -79,6 +79,19 @@ class misc(commands.Cog):
|
||||||
message = message + f"<@{t.owner_id}>: {t.jump_url}\n"
|
message = message + f"<@{t.owner_id}>: {t.jump_url}\n"
|
||||||
await interaction.response.send_message(message, allowed_mentions=nextcord.AllowedMentions.none())
|
await interaction.response.send_message(message, allowed_mentions=nextcord.AllowedMentions.none())
|
||||||
|
|
||||||
|
@commands.Cog.listener('on_thread_update')
|
||||||
|
async def threadupdatehandler(self, before: nextcord.Thread, after: nextcord.Thread):
|
||||||
|
pins = await after.parent.pins()
|
||||||
|
for t in pins:
|
||||||
|
if t.author.id == self.bot.application_id and t.content.split("\n")[0] == f"Active threads in {after.parent.jump_url}":
|
||||||
|
message = f"Active threads in {after.parent.jump_url}\n"
|
||||||
|
for p in after.parent.threads:
|
||||||
|
if p.archived:
|
||||||
|
continue
|
||||||
|
message = message + f"<@{p.owner_id}>: {p.jump_url}\n"
|
||||||
|
await message.edit(message)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def setup(bot: commands.Bot):
|
def setup(bot: commands.Bot):
|
||||||
bot.add_cog(misc(bot))
|
bot.add_cog(misc(bot))
|
Loading…
Reference in a new issue