CRUD - TsubakiBotPad/pad-cogs GitHub Wiki
NOTE: The CRUD cog is only functional if you are running an instance of the official pipeline. In Tsubaki, these commands only work in the #monster-pipeline-editing
channel in the official Tsubaki server, and it's recommended that you set up similar gating in your own instance for record-keeping purposes.
The CRUD cog is a cog used to write to the SQL and JSON files that are exported with the Tsubaki pipeline. Right now, it supports making edits to some fields of monsters and all fields of series and awoken_skills.
The CRUD cog allows for full operations on the series and awoken_skills table. The settable columns for each are:
Series:
-
name_en
,name_ja
,name_ko
, andseries_type
Awoken Skills:
-
name_en
,name_ja
,name_ko
,desc_en
,desc_ja
, anddesc_ko
To search within a table, you simply write ^crud <subcommand> search <query>
. The bot will then show you all items that have the query string as a substring of the English or Japanese name. This is very helpful to find a row's ID.
The command to add a new row is ^crud <subcommand> add <values>
. The values field is written in key value pairs. For example, if you wanted to add a series called "Test Series" with a series_type of "normal", you'd write ^crud series add name_en "Test Series" series_type "normal"
The quotes can be omitted for any single-word value.
Notes:
- When adding an awoken skill, you must supply an
awoken_skill_id
.
The syntax to edit a series is similar to add
with the added field of the id.
^crud <subcommand> edit <id> <values>
Notes:
- When adding an awoken skill, you may use the associated emoji name instead of the id.
To delete a row, use ^crud <subcommand> delete <id>
Only two commands are supported to edit monsters: one to change a monster's English name override, and one to change its series.
To change a monster's series, first find the series id via ^crud series search
and then run ^crud editmonsseries <monster_id> <series_id>
. You can also locate the series ID using ^debugid
and then looking at the modifier seriesXXX
.
To change a monster's English name override for translation purposes, the command is ^crud editmonsname <monster_id> <translation>
. The translation shouldn't be surrounded by quotes, even if there are spaces in it. Once a monster gets an official English language translation, you can remove the custom translation via ^crud editmonsname <monster_id> none
.
There are four owner-only setup commands for this cog.
In order to use the CRUD cog, you must set these two commands first.
^crud setconfig <path/to/config>
is used to point to the SQL config file so that this cog can edit the MySQL database.
^crud pipline_base <path/to/pipeline>
is used to point to the base of the pipeline directory so that the series JSON can be directly edited.
^crud setchan <channel>
and ^crud rmchan
are used to set and remove the CRUD channel. If set, CRUD commands from non-owners will only be valid in that channel.