Giveaway-bot | complete code for a Discord bot | Bot library
kandi X-RAY | Giveaway-bot Summary
kandi X-RAY | Giveaway-bot Summary
A complete code for a Discord bot to do contests. Easy to modify and free ! Also available in french.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Giveaway-bot
Giveaway-bot Key Features
Giveaway-bot Examples and Code Snippets
Community Discussions
Trending Discussions on Giveaway-bot
QUESTION
i have a problem. I want to make a task for my giveaway-bot for checking if a giveaway ended. So I created a task for doing it and it runs many lines of code and everything is working. But I noticed that my code is pretty slow. Can anyone help me and say what I can improve and how to speed this up?
I use aiomysql for connecting to my mariadb database and time.time() for checking the code speed.
Sorry if I'm making something wrong, I'm new on this site, feel free to comment if you need anything from me. :)
My Discord-py task:
...ANSWER
Answered 2021-Aug-10 at 22:15I see you have a lot of quarry's in the your loop that's the reason why its so slow. cant you make one big quarry? your mysql database will be quicker in sorting data of python.
maybe some hints to begin:
- i see you sort out non nitro account but i dont see it in your first quarry.
- i see you select all messages, maybe only take the messages after the start of the give away? so your script doesn't have to go through all the data.
- almost all if statements (about sorting data) can be written in a quarry's
im not that good whit databases myself, but if i can see your database and specifically know what you want from the query (i suspect a list of possible winners), maybe i can help. and how long takes this script right now?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Giveaway-bot
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page