A discord.py bot for shavit's bhoptimer.
Support Server, PR's and issues are also welcome.
Includes:
- Updating status message including playercount and current map (attempts to detect if server is offline).
- Formatted list of online players, including hyperlinks to profiles.
- RCON command execution, with console output.
- Ability to check for a map within the mapcycle.
- Ability to download (from GameBanana or Sojourner.me), extract, compress and send maps to FastDL (local or via FTP), including updating the mapcycle.
Works with Python 3.7+:
- Clone this repository.
- Install requirements with
pip install -r requirements.txt
. - Edit
config.json
. - Run using
python bot.py
/python3 bot.py
.
- token - the Discord bot's token, found in the developer portal page for your application. If you are unsure on how to create a bot user, follow this guide.
- prefix - the prefix used for bot commands.
- server_ip - the bhop server's IP address.
- server_port - the bhop server's port number.
- rcon_password - the password used for RCON commands, if there isn't one for your server, add one to
server.cfg
, then edit this field. - mapcycle - the path to your server's mapcycle file, absolute path recommended, usually located in
cfg/mapcycle.txt
. - maps_folder - the path to your server's maps folder, absolute path recommended, usually located in
cstrike/maps/
. - ftp_ip - the IP address to your FTP server for FastDL, leave blank if FastDL is local.
- ftp_user - the username to your FTP server for FastDL, leave blank if FastDL is local.
- ftp_pass - the password to your FTP server for FastDL, leave blank if FastDL is local.
- fastdl_folder - the path to your server's maps folder on FastDL, absolute path recommended.
- admin_ids - a comma-separated array containing Discord ID's of users that will be allowed to execute RCON commands.
- thumbnail - a link to an image that will serve as the 'thumbnail' for all embeds, can be left blank.
- maps_channel - an ID of a Discord channel that will be used to send messages about newly added maps, can be left blank.
- Displays a list of online players, and bots.
- Will also tell users if there is no one online.
- Allows execution of RCON commands, has 3 types of output:
- No response (no command supplied).
- Embedded response (standard).
- File response (over 2000 characters).
- Tells the user if a specific map is in the current mapcycle.
- Prefixless! Allows the user to enter a mapname without the bhop_, kz_ or kz_bhop_.
- Error message on non-existent map.
- Allows the user to download maps onto the server, and uploads them to FastDL automatically.
- Prefixless!
- Supports Sojourner.me (CASE SENSITIVE).
- And GameBanana.
- If the
maps_channel
field is included, a message will display in a separate channel informing users of new added maps.
- Downloading maps may still work if the FTP is online, or the FastDL is local.
- The bot will not go back online if offline, it must be restarted when the server is back online.
- bzip2 compression stage is not async.
- In !players, bots have the time played, as well as their respective replay time.
- cherry - Showing me the initial idea of being able to remotely download maps to a server.
- lorp - Few fixes + constructive criticism of code.
- chris - Fix for the RCON embed.
- Jeft - Fixes + general help with discord.py.
- Evan - Open sourcing his bot which served as the base initially.
- kangaroo hoppers - Continuous usage of the bot, allowing me to find errors and add additional features.
- zammyhop - Initial users of the bot.