Videonauth / ProtonDB-Bot

MIT License
4 stars 0 forks source link

Requests is a bad library to use with discord.py #24

Open Scotsguy opened 5 years ago

Scotsguy commented 5 years ago

While it does not matter much for such a small bot, the requests library is blocking, and will completely halt the event loop - meaning that if a request goes on for long enough, or often enough, the bot will disconnect. Additionally, only one request can be sent at a time, across every server and channel.

The proper, async library is aiohttp

P.S. Is there any reason for f-strings like these?

Videonauth commented 5 years ago

There is no apparent reason for those f-strings, except i needed something easy to remember while writing the module. and this way i could make sure i can reuse them as they point to the right places i conduct my search requests, as for aiohttp I will look into that.