Introduction¶
Ready to get your Python on and create a Discord bot? This guide's got you covered with installation options and a basic bot code example.
Requirements¶
- Python 3.10 or greater
- Know how to use
pip
- A bot account
- An aversion to puns
Installing and Setting up a Bot¶
Virtual Environments¶
We strongly recommend that you make use of Virtual Environments when working on any project. This means that each project will have its own libraries of any version and does not affect anything else on your system. Don't worry, this isn't setting up a full-fledged virtual machine, just small python environment.
1 2 3 |
|
1 2 3 |
|
It's that simple, now you're using a virtual environment. If you want to leave the environment just type deactivate
. If you want to learn more about the virtual environments, check out this page
Pip install¶
Now let's get the library installed.
1 |
|
1 |
|
Basic bot¶
Note
This is a very basic bot. For a more detailed example/template bot that demonstrates many parts of interactions.py, see the boilerplate repository.
Now let's get a basic bot going, for your code, you'll want something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Congratulations! You now have a basic understanding of this library. If you have any questions check out our other guides, or join the Discord Server
For more examples, check out the examples page