Danny, creator of discord.py, is halting development of the library. Discord.py has come to an end - will likely have a major effect on bots
Newest 'discord.py' Questions - Stack Overflow
Is discord bot development with python becoming deprecated?
No there are a lot of other libraries
And discord official is an API so you can always go back to the basic raw api calling
More on reddit.comMy first real project! A RollBot using discord.py
Any feedback would be greatly welcomed. I'll be updating it as I go, but I am so excited to go from 0 to this.
So I'll give some points to improve on:
Put IDs and bot tokens in a config file, and provide an example config with fake values. That way you can avoid breaking the code when uploading the public version. It is not obvious exactly where in the code your IDs should go (and which IDs to use) without reading the whole code and looking at discord.py's documentation.
No need to calculate
dicerollfor every voice state change. Just calculate it right before you use it, because for the majority of voice state changes your bot sees you won't be needing it.No need to look up
my_channeluntil you need it either.You check
if member == client.get_user():twice in such a way that the second time you check it, it's guaranteed to be true. You should remove one of those two checks.The code rolling the dice and sending it (on voice state change) should probably be its own function. The checks can stay in the voice state change function, but the actual dice rolling feels like a separate idea when compared to the idea of checking voice states, so it should probably be in a separate function.
Personally I host my bots on OVH (on their £3/month tier) but I heard that Google Cloud, Amazon AWS, and Microsoft Azure all do their own free tiers. If you don't know the linux/unix command line, learn it, because adding Windows onto a server greatly increases its cost due to licensing fees.
More on reddit.comVideos
» pip install discord.py
» pip install discord.py-self