Просмотр исходного кода

Updating readme and main source

tags/1.0.1
Rocketsoup 4 лет назад
Родитель
Сommit
2b53be6476
2 измененных файлов: 23 добавлений и 3 удалений
  1. 17
    1
      README.md
  2. 6
    2
      rocketbot.py

+ 17
- 1
README.md Просмотреть файл

1
 # python-app-rocketbot
1
 # python-app-rocketbot
2
 
2
 
3
-Experimental Discord bot written in Python and hosted in Django
3
+Experimental Discord bot written in Python.
4
+
5
+## Usage
6
+
7
+* To see the list of commands, type `$rb_help`.
8
+* To get help on a specific command, type `$rb_help command` (don't prefix the command name you want help on)
9
+* To get help on a command group, type `$rb_help group`
10
+* To get help on a subcommand in a group, type `$rb_help group command`
11
+* To see if the bot is alive, type `$rb_hello`
12
+
13
+## Setup
14
+
15
+Currently the bot is just run in the console locally. It blocks until Ctrl+C is pressed. Before running, you must copy config.py.sample to config.py and fill in the "client_token" value. To get a token, visit https://discord.com/developers/applications and create an application. Then create a bot for the application and enable the "server members intent". Click the "copy" button in the "token" section near the top and paste this value into config.py's "client_token" attribute.
16
+
17
+Create a "config" subdirectory under your source folder. This is where guild-specific configuration is written as JSON files.
18
+
19
+To start, run `python3 rocketbot.py`. Then visit https://discord.com/oauth2/authorize?client_id=[application_id]&scope=bot&permissions=395204357318, where [application_id] is the "application id" value on your app configuration "general information" page. Once invited, test if the bot is working by typing `$rb_hello` in your Discord server.

+ 6
- 2
rocketbot.py Просмотреть файл

1
 """
1
 """
2
-Rocketbot Discord bot. Relies on a configured config.py (copy config.py.sample for a template) and
3
-the sqlite database rocketbot.db (copy rocketbot.db.sample for a blank database).
2
+Rocketbot Discord bot. Relies on a configured config.py (copy config.py.sample
3
+for a template).
4
 
4
 
5
 Author: Ian Albert (@rocketsoup)
5
 Author: Ian Albert (@rocketsoup)
6
 Date: 2021-11-11
6
 Date: 2021-11-11
18
 
18
 
19
 CURRENT_CONFIG_VERSION = 3
19
 CURRENT_CONFIG_VERSION = 3
20
 if (CONFIG.get('__config_version') or 0) < CURRENT_CONFIG_VERSION:
20
 if (CONFIG.get('__config_version') or 0) < CURRENT_CONFIG_VERSION:
21
+    # If you're getting this error, it means something changed in config.py's
22
+    # format. Consult config.py.sample and compare it to your own config.py.
23
+    # Rename/move any values as needed. When satisfied, update "__config_version"
24
+    # to the value in config.py.sample.
21
     raise RuntimeError('config.py format may be outdated. Review ' +
25
     raise RuntimeError('config.py format may be outdated. Review ' +
22
         'config.py.sample, update the "__config_version" field to ' +
26
         'config.py.sample, update the "__config_version" field to ' +
23
         f'{CURRENT_CONFIG_VERSION}, and try again.')
27
         f'{CURRENT_CONFIG_VERSION}, and try again.')

Загрузка…
Отмена
Сохранить