Configuration
The configuration for EnduraBot takes place in 3 files.
|ββdata /
| |ββ misc_text.json
| |ββ permissions.json
| βββ variables.json
Variables¶
variables.json has the meat and potatoes of relevant configuration.
| Variables | Description |
|---|---|
repo |
The raw URL to the bot's GitHub repository. If you have forked the bot, you'd replace this with your own. |
docs |
The raw URL to the bot's documentation. If you have forked the bot, you'd replace this with your own. |
version |
The current version of the bot represented as a string. |
quotes_channel_id |
The Discord channel ID of the channel containing out of context quotes. |
alert_channel_id |
The Discord channel ID of the channel where systems operators talk; used by /alert and /estop as the channel to send notifications. |
general_chat_channel_id |
The Discord channel ID of the channel daily bible quotes and /trole notifications should be sent. Treated like a #general channel for the server. |
invite_alert_channel_id |
The Discord channel ID of the channel that invitation tracking alerts should be sent too. |
sysop_role_id |
The Discord role ID of the role denoting a member is a systems operator. |
mod_role_id |
The Discord role ID of the role denoting a member is a server moderator. |
cooldown_exempt_roles |
List of roles exempt from the /rquote cooldown. |
links |
List of key value pairs where the key is a raw URL to a community resource and the value is a description of what the URL is. |
ip |
The raw IP address to the community's infrastructure. |
url |
The root URL for web applications and services. |
rquote_cooldown_in_seconds |
The number of seconds that should pass before a non-exempt user can run /rquote again. |
game_cooldown_in_seconds |
The number of seconds that should pass before a user can run /game again. |
game_num_uses_before_cooldown |
The number of times that anyone can run /game before the cooldown triggers. |
max_old_quotes |
Maximum number of quotes generated by /rquote or the daily bible quote to keep in memory as not being allowed to be selected again. Once met, all new invocations will have the oldest entry put back into circulation. |
rquote_footer |
The text of the embed footer used for /rquote and the daily bible quotes. |
bot_insult_chance |
The chance that the bot will insult a user which pings it. Must be a float between 0 and 1. |
bibleq_hour_of_day |
The hour of the day in UTC that the daily bible quote should be sent. |
bibleq_min_of_day |
The minute of the bibleq_hour_of_day hour that the daily bible quote should be sent. |
log_new_day_hour_utc |
The hour of the day in UTC that a new log-date header should be generated.1 |
rquote_regex |
Raw regex used by /rquote to determine whether a message should be selected. Any part of the message not meeting the regex criteria will be stripped before presentation. |
ports |
A list of key value pairs where the key is the name of a service that the community's infrastructure is providing and the value is the port number to access the service. |
mod_editable_roles |
A list of key value pairs where the key is the name of a role and the value is the role's Discord ID.2 |
blacklisted_itad_shops |
A list of key value pairs where the key is the name of a shop that sells games and the value is the ITAD internal ID for the shop.3 |
disabled_cmds |
A list of command names that, if present, will result in them being unable to be used. |
log_text_exclude |
List of strings that, if found in a log line, will cause the entire line to be excluded from the output of /logs. |
rquote_themes |
A list of dedicated JSON objects that define the various themes /rquote uses. See: Random Quote (/rquote) |
Permissions¶
As of version 2.1 EnduraBot centralized it's permissions checking to the contents of data/permissions.json.
{
"editrole": [
1426035365671731292
],
"alert": [
3456789012345678901
]
}
The keys (e.g editrole) are the programmatic function names of registered commands. The value of the key, being a list, are role IDs authorized to use the command.
If a registered command does not have an entry in permissions.json EnduraBot will presume that anyone in the server may use it. Furthermore, any member on the server with the Discord Administrator permission automatically passes all permissions checks.
To find the programmatic name for a command one may search the files in the cogs folder. Unless the entire file is dedicated to one command, generally, comments precede the code that registers a command.
Lets take a look at the /about command.
# --- COMMAND: /about ---
@app_commands.command(name="about", description="Get information about EnduraBot.")
@app_commands.check(check_permissions)
@app_commands.guilds(GUILD_ID)
async def about(self, interaction: discord.Interaction):
In the above case the programmatic name for the command is about. It is the name of the declared asynchronus function (async def) following the decorator registering a Discord application command (@app_commands.command()).
Miscellaneous text¶
Certain functions of EnduraBot rely on lists of string values in order to function properly. These are stored here.
| Variables | Description |
|---|---|
bible_gospels |
JSON list of Bible gospels that the daily bible quote function will use as the "source" of a given quote. |
daily_bible_openers |
JSON list of various phrases that the "preacher" who is "sending" the daily bible quote will say prior to showcasing the selected quote. |
server_identifiers |
Used in conjunction with the issue_identifiers JSON list in this same file. If any word in this list and any word in the issue_identifiers list is found in a message that pings sysop_role_id, the message will be deleted and replaced with an embed asking the user to use /alert. |
issue_identifiers |
Used in conjunction with the server_identifiers JSON list in this same file. If any word in this list and any word in the server_identifiers list is found in a message that pings sysop_role_id, the message will be deleted and replaced with an embed asking the user to use /alert. |
bot_insults |
List of insults the bot will use if the bot_insult_chance is met or exceeded when someone pings it. |
ooc_XXX |
List of available opening statements for the configured /rquote themes. See: Random Quote (/rquote) |
-
This is primarily used for readability; to ensure that logs are seperated by the day the logged item ocurred. These headers look like this:
--- Sunday, December 07, 2025 (20251207) | 21:28 ---↩ -
The first key value pair will be the role that
/troledefaults to if it'sroleargument is not populated. ↩ -
Shop IDs can be found by reviewing EnduraBot's logs for any successful game lookup. ↩