Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
Use JSON for tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
b1naryth1ef committed Feb 15, 2018
1 parent 60fbb62 commit c86824a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs/bot_tutorial/first_steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Once you have a Discord bot account, you can then setup your workspace. For now

```
disco-tutorial/
config.yaml
config.json
plugins/
__init__.py
tutorial.py
Expand All @@ -23,12 +23,15 @@ The \_\_init\_\_.py file is required for Python to find your plugin, but it can

Now let's setup the configuration file. To start off with we'll paste the following template in and modify our token key (`MY_BOT_TOKEN_HERE`) to be the token we obtained above. The plugins section tells disco what plugins to load, based on a module path (similar to how Python imports work). In this example we're asking disco to load the plugin contained in the tutorial file within the plugins directory (or "module"). Disco by default loads the first plugin it finds within the module, so you want to make sure each plugin class is contained within its own file.

```yaml
token: 'MY_BOT_TOKEN_HERE'

bot:
plugins:
- plugins.tutorial
```json
{
"token": "MY_BOT_TOKEN_HERE",
"bot": {
"plugins": [
"plugins.tutorial"
]
}
}
```


Expand All @@ -48,7 +51,7 @@ Now that we have a plugin setup and our configuration is ready, we can run and t


```sh
python -m disco.cli --config config.yaml
python -m disco.cli --config config.json
```

If all is successful, you can then test your bot by mentioning it with the command, like so:
Expand Down

0 comments on commit c86824a

Please sign in to comment.