4.4 KiB
4.4 KiB
Fabcat!
meow meow! welcome to fabcat! a discord bot for Fabsoc made by Tabby
Version 0.1
Basic Commands
This commands can be used by anyone!
/helpdisplays this help screen/printer-statusdisplays the currently loaded spools and nozzle for each printer/spool-listdisplays a list of both loaded and available spools
Technician Only Commands
Since these commands edit data, only users with the technician role may use them
Printer Management
/printer-create <name>Creates a new printer with the provided name/printer-delete <name>Deletes the printer with the matching name/printer-slots <name> <slots>Changes the amount of spool slots a printer has (for example: if an AMS is attached)/printer-nozzle <name> <new_nozzle>Changes the nozzle attached to the printer/printer-load <printer-name> <spool-name>Loads a spool into a printer, If the printer only has one spool slot and it is filled then this command will replace it and return the old spool to the library (offers option to delete old spool)/printer-unload <printer-name>Unloads the spool from the printer, If there are multiple a dropdown asks which to unload. The unloaded spool can then be kept in the library or deleted
Spool Management
/spool-create <name> [link]Creates a new spool with the given name and optionally a link to it/spool-delete <name>Deletes the spool with the matching name, can only delete a spool if it is in the library (not loaded into a printer)/spool-edit <old-name> <new-name> [new-link]Changes the name and/or link of a spool, only works if the spool is in the library (not loaded into a printer)
Contributing to fabcat
[!Warning] Work in progress
fabcat is made in Godot v4.5 with the discord.gd plugin. To edit the project follow these steps:
- Download Godot v4.5
- Clone the fabcat repo to your computer
- Add the
.envfile with the discord bot key (ask Tabby) - Open the project folder with Godot
Project Structure
main.gd- main script which manages everything at the top level, you shouldn't need to touch thisTools.gd- global script that contains helper functions usable from anywhere, currently just has a function to check if the user has the right permissionsAutocompleteTools.gd- global script that contains helper functions for command autocompletelibrary.gd- global script that manages the printer and spool librarydatatypeslibrarySave- class used bylibrary.gdto save data to storageprinter- class used to represent a printerspool- class used to represent a spool
application_cmds- folder that holds all the commands for Fabcat, do not rename or place commands elsewhere as they will not be picked up
Application Command Structure
Each application command file is made up of up to 5 key parts, only execute() and data are required for a minimal command:
on_ready()- this function runs once when the bot starts up, useful for connecting signalson_autocomplete()- this function is run every time the bot receives a new partially typed argument and can return a list of entries for the user to pick fromexecute()- function that is run when the user runs the commandon_interaction_create()- gets run whenever the user interacts with components in a message such as buttons or a dropdown, requires a signal connection to be made inready()data- defines the structure and arguments of the application command
Useful Resources
Running an instance of fabcat
- In Godot, select
Project -> Export...and export the Linux build - This should create a few files which you should move to your server, make sure to move the
.envfile here too - You may need to give the
.x86_64executable permissions - run the executable with the
--headlessargument The bot should then be running! You may want to consider creating some sort of startup task so the bot can continue if something happens to the server