Rxy
Rxy
DIAdiscord.js - Imagine an app
Created by Rxy on 2/26/2024 in #djs-questions
My Bot isn't Deleting Archived Threads
When a Thread is closed or archived, it cannot delete the thread. It only deletes unclosed or active threads but I'd like it to delete threads regardless of if they are open, archived or closed within an hour. Any Idea whats wrong here? using Python and latest version of JS
@tasks.loop(seconds=7.5)
async def check_and_delete_threads():
try:
# Replace CHANNEL_ID with the actual ID of the channel you want to check for threads in
channel_id =
channel = bot.get_channel(channel_id)

# Replace EXCLUDED_THREAD_ID with the ID of the thread you want to exclude from deletion
excluded_thread_id =

if channel:
for thread in channel.threads:
if thread.id == excluded_thread_id:
continue

# Check if the thread is older than 2 hours
if time.time() - thread.created_at.timestamp() >= 7200 or thread.archived:
await thread.delete()
print(f"Thread {thread.name} deleted.")
# Remove thread info from the dictionary
thread_info.pop(str(thread.id), None)
@tasks.loop(seconds=7.5)
async def check_and_delete_threads():
try:
# Replace CHANNEL_ID with the actual ID of the channel you want to check for threads in
channel_id =
channel = bot.get_channel(channel_id)

# Replace EXCLUDED_THREAD_ID with the ID of the thread you want to exclude from deletion
excluded_thread_id =

if channel:
for thread in channel.threads:
if thread.id == excluded_thread_id:
continue

# Check if the thread is older than 2 hours
if time.time() - thread.created_at.timestamp() >= 7200 or thread.archived:
await thread.delete()
print(f"Thread {thread.name} deleted.")
# Remove thread info from the dictionary
thread_info.pop(str(thread.id), None)
9 replies
DIAdiscord.js - Imagine an app
Created by Rxy on 2/2/2024 in #djs-questions
Mark Post as Solved?
I really like the "Mark post as solved' feature, I would generally like to achieve the same thing since I am using the Forums format as an LFG Sytem for my Server. So I would like the post to only be able to be 'Marked as Solved' by the Original Poster or Staff. Which will then Archive the Post.
6 replies
DIAdiscord.js - Imagine an app
Created by Rxy on 2/2/2024 in #djs-questions
How can I reference a Forum Format Post?
I am currently developing a bot to automatically delete forum posts for me, so I would like to know how to reference a forum post from the moment it is created and then delete that specific forum post a certain amount of time later.
5 replies