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
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

102
102
103
-
### Variable and Keyword-Only Arguments
103
+
### Variable and Consume Rest Arguments
104
104
105
105
There may be times where you wish for an argument to be able to have multiple words without wrapping them in quotes. There are two ways of approaching this.
106
106
107
107
#### Variable
108
108
109
109
If you wish to get a list (or more specifically, a tuple) of words for one argument, or simply want an undetermined amount of arguments for a command, then you should use a *variable* argument:
0 commit comments