#Interaction not responding

1 messages · Page 1 of 1 (latest)

fervent dust
#

Hello I have been working on a bot for a while now and I have a loop that consists of people entering server names in it and the loop checks for if its offline / online. Only till recently their has been more servers in the loop for it to check for.

The loop works fine however my commands response times have been affected by this, I have ctx.defer() on my commands but this only works sometimes. My commands keep saying The application did not respond, is their any fix that anyone knows of?

tranquil laurel
fervent dust
tranquil laurel
#

consider using tasks.loop instead of a while loop

#

b!rtfm pyc discord.ext.tasks

fervent dust
#

does tasks.loop only work in cogs? @tranquil laurel

tranquil laurel
#

no, it also works outside of cogs

fervent dust
#

hmm

#

doesnt seem to be looping

tranquil laurel
#

you should start the loop

fervent dust
tranquil laurel
#

that's not how you start a task loop

fervent dust
#

oh

fervent dust
tranquil laurel
#

you have the tasks.loop decorator on your server_reports?

fervent dust
#

yes

tranquil laurel
#

server_reports.start()

fervent dust
#

alright loop works now but commands still timing out

lucid sparrow
#

I suggest you use aiosqlite which is basically sqlite but async

fervent dust