A fun Discord bot based on the indie game Baba Is You (by Arvi Teikari). This bot was written with the discord.py library.
This bot features an "editor"-like renderer, letting you render custom scenes using sprites from Baba Is You! The tile and rule commands can be used to render just about anything you want!
As hinted at by these demos, there's plenty of nuance in the output -- you can customize to a staggering degree! The following is an example of what you can make:
In addition to custom renders, the bot also features a level command which searches levels by query and renders them. This also supports custom uploaded levels.
There are also a number of complementary utility commands, including the hint command to provide level hints and the search command to search through tiles, levels, color palettes, etc.
A full list of commands can be seen using the help command.
Leave any suggestions, bug reports or questions in the official support Discord server.
Please follow the terms of the license!
Install the requirements: pip install -r requirements.txt.
Run the bot using python3 ROBOT.py.
(The bot may not work properly on Windows, as it makes use of some unix-ish shell commands for the convenience of the programmer.)
Bot configuration is in config.py. It contains the following values:
activity:str- A "playing" message to set at login.description:str- A description to use in the help command.prefixes:list[str]- A list of strings that can be used to trigger commands.trigger_on_mention:bool- Whether or not bot @mentions will behave as a command prefix.db_path:str- The path to the sqlite3 database used by the bot.embed_color:discord.Color- The color of embedded messages.log_file:str- The file to report logs to.cogs:list[str]- A list of strings -- cogs to load into the bot.original_id:int- If one of your bots can't be invited to servers, put that ID here. Otherwise, set it to 0.
In addition, authentication information should be placed in auth.py:
tokens:list[str]- A list of bot tokens to use for running this.webhook_url:str- The webhook url used for logging.
If the bot complains about missing files or directories in cache/ or target/, create them.
<> denotes a required argument, and [] denotes an optional argument.
-
loaddataCollects tile metadata fromvalues.lua,editor_objectlist.lua,data/worlds/baba/*.ldfiles anddata/custom/*.jsonfiles, and saves it to disk. The following commands are also available, but it is strongly recommended to useloaddata. -
loadlettersScrapes individual letter sprites from image sprites indata/sprites/*, as well as pre-made letters fromdata/letters/**/*and places the results intarget/letters/. -
loadmap <world_name> <level_id>Reads and renders an animated GIF of the provided level.world_nameshould bebabain most cases. The level metadata is untouched. Useful for re-rendering levels changed in an update without re-doing everything. -
loadworld <world_name> <should you render mobile levels?>Reads and renders every single level indata/levels/<world>/. Also collects metadata. -
To load tile data, run the
loaddatacommand. To load letter data (for custom text), run theloadletterscommand. To load and pre-render levels, run theloadworldcommand.
<> denotes a required argument, and [] denotes an optional argument.
load [cog](aliases:reload,reloadcog) Reloads a cog. Useful to hot-reload modules of the bot. If the argument is omitted, all cogs are reloaded.restartExits the bot with a return code of 1. (I use this with a process manager that restarts failed tasks.)logout(aliases:kill,yeet) Exits the bot with a return code of 0.ban <user_id>Adds a user ID to the list of blacklisted users. (This might actually be broken, haven't tested properly)leave <guild_id>Leaves a guild.hiddenLists all hidden commands.doc <command>Displays the docstring for a command.
The bot additionally uses Jishaku to interface with git, run shell commands and evaluate python. Read more about the jsk command at Jishaku's documentation.




