Spiritual successor to the NeoZones original CyberBus bot.
trwnh 820a5c2f38 actually get original url | 1 year ago | |
---|---|---|
.vscode | 2 years ago | |
cogs | 1 year ago | |
pycord @ 9b7f5c6be6 | 2 years ago | |
sounds | 2 years ago | |
utils | 2 years ago | |
.gitignore | 2 years ago | |
.gitmodules | 2 years ago | |
.style.yapf | 2 years ago | |
README.md | 2 years ago | |
app.py | 2 years ago | |
icon.jpg | 2 years ago | |
icon2.png | 2 years ago | |
requirements.txt | 2 years ago |
CyberBus2 (codenamed Umi, currently powering Ricky#6849 on the NeoZones Discord server) is a spiritual successor to the original NeoZones CyberBus bot.
CyberBus2 is written in Python (3.10+) and makes use of the Pycord library (latest commits from the master branch, v2.0 rewrite pre-release). It is therefore considered bleeding-edge.
Within Pycord, you should be aware of the following concepts:
setup()
function which can be used to prepare a Bot or Client for operation. Generally, this is used to add the external Cog to the Bot or Client.Within Python, you should be aware of the following concepts:
async
before functions, and await
before coroutines within those functions. Essentially, you should__init__()
function will initialize each instance of the Class. Because of this, it requires a self
parameter, and consequently, all functions within that class will also require a self
parameter. This parameter is implied, meaning it does not have to be explicitly passed into function calls; instead, self
must be used as a prefix in order to reference the function contained within the instance of the Class object. For example, if you write a function with def function(self)
, you would call it elsewhere with self.function()
instead of with function(self)
. Any additional parameters can be passed in like normal.The main script used to run this application is found in the root of the repository at app.py
.
Extensions are loaded from the cogs/
folder. Currently, the following cogs are provided:
on_member_join
, on_member_remove
, on_member_ban
, and on_member_unban
.sounds/normalized
directory, and the normalize
bash script in sounds/
can be used to automatically normalize any audio files placed in sounds/originals
. This cog uses message commands.on_message
.on_raw_reaction_add
and on_raw_reaction_remove
, and it also uses message commands and application commands.:trash:
when any reference to Among Us is made. This cog uses listeners for on_message
.Some utility scripts are provided to interface with the Discord REST API. These scripts can be found in the utils/
folder. Currently, the following scripts are provided:
For use with the music cog, a sounds/
directory is provided.
sounds/originals
subdirectory, and additional subdirectories are supported.normalize
Bash script should be used to normalize all audio within the originals
subdirectory. This requires ffmpeg-normalize.sounds/normalized
subdirectory, which is where the normalize
script will output all of its files.git clone <url>
cd CyberBus2
git submodule update --init
virtualenv .venv
source .venv/bin/activate
BOT_TOKEN = <insert your token here>
python app.py
Currently, the following are hardcoded:
play
or playtop
, which can be removed or modifiedroles
, where a role can be of type COLOR_
, PING_
, or PRONOUN_
-- this can be changed, but make sure to change the /color
application command if you do soif
statements/color
application command's decorator