This is the newest iteration/amalgam of the many discord bots I've made over the years. I plan on adding new bots and re-implementing old bots in this new and improved system! The bot itself is a collection of multiple pieces, each with vastly different functionalities. There certainly will be more to come as our server never has enough bots (lie).
What the hell is Sexybabeycord?: Sexybabeycord is the current iteration of the Discord server that I share with my close friends (we accidentally nuked the last one with homemade spambots). It's more of a chaotic groupchat than a high-functioning Discord 'community,' as we all have Administrator permissions, and we don't particularly care for rules. I love making bots for our server, and my friends seem to as well.
Special thanks to @CowZix for creating the asher
cog. He is a truly elite contributor.
Sexybabeycord uses poetry to manage most dependencies, so it should be fairly easy to set up on a new host.
git clone https://github.com/vaughnw128/sexybabeycord
cd sexybabeycord/
$ curl https://pyenv.run | bash
Add the following lines to ~/.bashrc and ~/.profile:
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
Then, add the following like to ~/.bashrc to automatically initialize the virtual environment:
eval "$(pyenv virtualenv-init -)"
Finally, restart your shell and use pyenv to set the version. Currently, this version of Sexybabeycord uses Python 3.11.5.
$ pyenv install 3.11.5
$ pyenv local 3.11.5
$ curl -sSL https://install.python-poetry.org | python3 -
$ poetry self add poetry-dotenv-plugin
$ poetry install
MacOS:
$ brew install ffmpeg magickwand pre-commit
Unix:
$ apt get install ffmpeg libmagickwand-dev pre-commit
In order to pass in some of the variables for Sexybabeycord, the .env file should be set up.
Then, it's necessary to create a .env
file to match the one in bot/resources/templates/env_template
in the root directory of the project. The tenor token is required to grab certain gifs posted from tenor, and can be obtained for free by following the Google Cloud Tenor Quickstart Guide
Additionally, some features require the use of a database, and some are supplemented by one. These features will be automatically disabled on startup of the bot if a database is not used. Finally, this bot is suited to only be used in a single guild at a time, therefore, the guild ID, general channel, and 'fate' channel must be passed in. If general or fate is not passed in, the corresponding features will not be available.
# TOKENS
DISCORD_TOKEN=
TENOR_TOKEN=
# DATABASE INFORMATION
MONGO_URI=
DATABASE_NAME=
# GUILD/CHANNEL INFORMATION
GUILD_ID=
GENERAL_CHANNEL_ID=
FATE_CHANNEL_ID=
Some cogs and utilities have build in unit tests. These features can be tested via pytest.
$ poetry run python -m pytest
Finally, once tests pass, the bot can be run
$ poetry run -m bot
Included with the bot is the ability to deploy it with Docker. The most recent image can be found under packages
on Github. If you desire to build the container yourself, it can be easily built.
$ docker build .
If you desire to use twitter accounts, they must be added to an attached docker volume. First make the volume and copy over the data:
$ docker volume create sexybabeycord_data
$ cp accounts.json /var/lib/docker/volumes/sexybabeycord_data/_data/accounts.json
Then to run the container:
$ docker run -d \
--name sexybabeycord \
-v sexybabeycord_data:/bot/data \
-e "DISCORD_TOKEN=" \
-e "TENOR_TOKEN=" \
-e "MONGO_URI=" \
-e "DATABASE_NAME=" \
-e "GUILD_ID=" \
-e "GENERAL_CHANNEL_ID=" \
-e "FATE_CHANNEL_ID=" \
--restart always \
ghcr.io/vaughnw128/sexybabeycord:latest
The current components (cogs) of the bot are as follows:
- Astropix: Scrapes and sends the NASA picture of the day every day at noon.
- Distort: Grabs images from messages then uses liquid rescaling to distort and resend them.
- fixlink: Takes any link to twitter, instagram, or tiktok, and fixes it with either the 'vx' or 'dd' prefix for proper embed formatting.
- fate: Uses twscrape to grab @JamesCageWhite's tweets and send them in our #fate channel. Love that guy.
- gabonganized: Gabonganizes all face pics sent. This adds a gabonga where someone's face is supposed to be.
- caption: Adds captions to images when you reply with the 'caption' keyword.
- Mood Meter: Allows users to select a coordinate from a drop down and then puts their profile photo on a mood matrix.
- Ytdl: Downloads youtube videos and clips with a command or menu button.
- Peanut gallery: Whenever someone sends a youtube link, a random comment from the video is automatically sent to chat
- Remind: Uses mongodb and crontab formatting to generate one-time reminders and recurring reminders
- Wrench: A small utility cog just for getting the JSON of a message
Made with love and care by Vaughn Woerpel