You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/Guides/01 Getting Started.md
+48-77Lines changed: 48 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,102 +9,73 @@ Ready to get your Python on and create a Discord bot? This guide's got you cover
9
9
-[x][A bot account](02 Creating Your Bot.md)
10
10
-[ ] An aversion to puns
11
11
12
-
## Installation Methods
12
+
## Installing and Setting up a Bot
13
13
14
-
There are two different ways to install this library and create your bot.
14
+
### Virtual Environments
15
15
16
-
=== "Using a Template"
16
+
We strongly recommend that you make use of Virtual Environments when working on any project.
17
+
This means that each project will have its own libraries of any version and does not affect anything else on your system.
18
+
Don't worry, this isn't setting up a full-fledged virtual machine, just small python environment.
17
19
18
-
We created a [cookiecutter template](https://github.com/Discord-Snake-Pit/Bot-Template) which you can use to set up your own bot faster.
19
-
With the template, your code will already have a well-defined structure which will make development easier for you.
20
-
21
-
We recommend newer devs to make use of this template.
22
-
23
-
### Template Feature
24
-
- Basic, ready to go bot
25
-
- Implementation of best practises
26
-
- General extensibility
27
-
- Example command, context menu, component, and event
Now let's get a basic bot going, for your code, you'll want something like this:
53
+
!!! note
54
+
This is a very basic bot. For a more detailed example/template bot that demonstrates many parts of interactions.py, see [the boilerplate repository.](https://github.com/interactions-py/boilerplate)
84
55
85
-
```python
86
-
from interactions import Client, Intents, listen
56
+
Now let's get a basic bot going, for your code, you'll want something like this:
87
57
88
-
bot = Client(intents=Intents.DEFAULT)
89
-
# intents are what events we want to receive from discord, `DEFAULT` is usually fine
58
+
```python
59
+
from interactions import Client, Intents, listen
90
60
91
-
@listen() # this decorator tells snek that it needs to listen for the corresponding event, and run this coroutine
92
-
async def on_ready():
93
-
# This event is called when the bot is ready to respond to commands
94
-
print("Ready")
95
-
print(f"This bot is owned by {bot.owner}")
61
+
bot = Client(intents=Intents.DEFAULT)
62
+
# intents are what events we want to receive from discord, `DEFAULT` is usually fine
96
63
64
+
@listen() # this decorator tells snek that it needs to listen for the corresponding event, and run this coroutine
65
+
asyncdefon_ready():
66
+
# This event is called when the bot is ready to respond to commands
67
+
print("Ready")
68
+
print(f"This bot is owned by {bot.owner}")
97
69
98
-
@listen()
99
-
async def on_message_create(event):
100
-
# This event is called when a message is sent in a channel the bot can see
0 commit comments