Archive thread if applicable.
(channel: discord.Thread | discord.TextChannel)
| 1510 | |
| 1511 | |
| 1512 | async def archive_thread(channel: discord.Thread | discord.TextChannel): |
| 1513 | """Archive thread if applicable.""" |
| 1514 | if isinstance(channel, discord.Thread): |
| 1515 | try: |
| 1516 | await channel.edit(archived=True) |
| 1517 | except discord.HTTPException as e: |
| 1518 | logger.warning(f"Failed to archive thread {channel.id}: {e}") |