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
The removal of the line that sets the prefix. We don't need it anymore!
88
92
{% endhint %}
89
93
94
+
## Using `token`, `prefix` in your code
95
+
96
+
Its the same thing like above. The only one that change is, that you don't need `config`.`(data)`.
97
+
You only need to use `token`for the bot token and `prefix`for the bot prefix.
98
+
99
+
#### Usage example of `token`
100
+
101
+
```javascript
102
+
client.login(token);
103
+
```
104
+
105
+
#### Usage example of `prefix`
106
+
107
+
```javascript
108
+
client.on("message", (message) => {
109
+
if (!message.content.startsWith(prefix) ||message.author.bot) return;
110
+
111
+
if (message.content.startsWith(prefix +"ping")) {
112
+
message.channel.send("pong!");
113
+
} else
114
+
if (message.content.startsWith(prefix +"foo")) {
115
+
message.channel.send("bar!");
116
+
}
117
+
});
118
+
```
119
+
90
120
## Changing the config
91
121
92
122
If you're asking yourself "but how do I change the prefix, now?" fear not, we have some help for you. We suggest you start by reading the rest of this section of the guide \("First Bot"\) and then hop on to the [Per-Server Configuration Guide on the Enmap Documentation](https://enmap.evie.codes/examples/settings)!
0 commit comments