1

I wanted to make a Poker Bot with python for discord so that I can play with my friends. I've never made a discord bot yet and I started to look around for some tutorials. What I found is that most of the people are not using classes for their bots. Are there any reasons for not using a class? My suggestion was to use for example a class for the player and a class for the game manager. Does anyone have a better idea how to implement a Poker Bot or can anyone tell me how to properly use classes to create a discord bot? Or is it maybe better to use another language for this project?

Thanks for your time

  • Does this answer your question? https://stackoverflow.com/questions/33072570/when-should-i-be-using-classes-in-python – Dominik Mar 09 '21 at 00:55
  • Try using [`discord.py` Cogs](https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html). – Jacob Lee Mar 09 '21 at 03:18
  • @JacobLee what would be the purpose of using extensions and cogs in this case? I don't understand the meaning of them yet. Can you give an example of how you would use cogs for this specific case? – Toilettenbrain Mar 09 '21 at 14:25
  • Cogs allow for the easy use of classes in `discord.py` scripts. Since I don’t know exactly how you plan to implement your program, I cannot give you a specific example. However, whenever you have groups of commands, using Cogs to organize those commands. So, you create create a cog for your player and one for the game manager, since I would think they have separate commands. – Jacob Lee Mar 09 '21 at 15:05

0 Answers0