galacticwarrior9 / IslamBot

A Discord bot that supports Qur'an, hadith, prayer times, tafsir and more.
GNU General Public License v3.0
88 stars 37 forks source link

Fix bug on typing for some commands not stopping when message sent #32

Closed itzmk21 closed 2 years ago

itzmk21 commented 2 years ago

discordpy docs gave this example of usage:

async with channel.typing():
    # do expensive stuff here
    await channel.send('done!')

While nextcord docs gave this:

async with channel.typing():
    # simulate something heavy
    await asyncio.sleep(10)

await channel.send('done!')

Basically

async with channel.typing():
   # expensive stuff
-  await channel.send('done!')
+await channel.send('done!')

Feel like the update in the nextcord docs shows there was an error in the discordpy docs itself, and with tests, the "endless" typing should be fixed, now.