|
|
3 лет назад | |
|---|---|---|
| rocketbot | 3 лет назад | |
| .gitignore | 4 лет назад | |
| .pylintrc | 4 лет назад | |
| README.md | 4 лет назад | |
| bot.py | 3 лет назад | |
| config.py.sample | 3 лет назад | |
| patterns.md | 4 лет назад |
Experimental Discord bot written in Python.
$rb_help.$rb_help commandname (don’t prefix the command name you want help on). E.g. $rb_help hello.$rb_help groupname. E.g. $rb_help config.$rb_help groupname commandname. E.g. $rb_help config setwarningchannel.$rb_hello.$rb_help for more.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.
Create a “config” subdirectory under your source folder. This is where guild-specific configuration is written as JSON files.
To start, run python3 bot.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.
Once running, you should immediately set up a warning channel and optionally a
user/role to tag in warning messages. Go to a channel you want warnings to be
posted (typically a channel the general userbase cannot see) and type
$rb_config setwarningchannel. This will set that channel as the destination
for warnings about suspicious behavior on the server. To have these messages
tag a user or role (such as @Mods), type $rb_config setwarningmention @userorrole.
This must be an actual autocompleted @ mention that shows up in a different
color, not just the name of the user/role. Otherwise warning messages will
be prefixed with that plaintext name, not with an actual @. To mention several
people or roles, enclose the whole list in double quotes. E.g.
$rb_config setwarningmention "@Mod @Admin". You can test out this configuration
by entering $rb_testwarn to issue a test warning.