A Discord bot for Denizen 1.x (Bukkit) meta documentation.
This is a C#/.NETCore based Discord bot.
Created by mcmonkey and the DenizenScript team.
Gathering the files note:
- In addition to a 
git cloneof this repository, you need to clone the sub-repository, using a command likegit submodule update --init --recursive. 
You need screen and dotnet-6-sdk installed.
The start.sh file is used by the restart command and should be maintained as correct to the environment to launch a new bot program instance... points of note:
- It starts with a 
git pullcommand to self-update. If this is not wanted, remove it. Be careful what repository this will pull from (a fork you own vs. the original repository vs. some other one...) - It uses a 
screencommand to launch the bot quietly into a background screen. Thescreenprogram must be installed for that to work. Alternately, replace it with some other equivalent background terminal program. - The restart command will run this script equivalently to the following terminal command: 
bash ./start.sh 12345where12345is the ID number for the channel that issued a restart command. 
To configure the bot:
- Create directory 
configwithin this bot's directory. - Within the 
configdirectory, create filetoken.txtcontaining only the Discord bot token without newlines or anything else.- To create a bot token, refer to official Discord documentation. Alternately, you can follow the bot-user-creation parts of https://discordpy.readthedocs.io/en/stable/discord.html (ignore the coding parts, just follow the first bits about creating a bot user on the Discord application system, and getting the token).
 
 - Optionally, within the 
configdirectory, create filequotes.txt, with a list of quotes for!quote, separated by double-newlines (ie, one complete blank line between each distinct quote). - Within the 
configdirectory, create fileconfig.fds(a FreneticDataSyntax file) with the following options (See also the full file text sample below) (most lines are optional):valid_channelsset to a whitelist of channels the bot responds in (left out = responds anywhere).info_repliesset to a submapping of info commands and their replies, which allows comma-separated list keys. The first listed name on each line is the primary name. Type\nto add a line break.project_detailsset to a submapping of project names to project details map, as follows:updateset to an update message for the project.githubset to a GitHub repo URL (if applicable)iconset to a.pngicon image URL.
channel_detailsset to a submapping of channels to details specific to the channel. Within each channel ID key is a submapping of the details, as follows:updatesset to what projects they correspond to (for the update command).docsset to whether meta docs are allowed in this channel.
url_baseset to the base URL of the meta website.rulesset to a submapping of rule IDs to their text.command_prefixset to the command prefix (for non-ping-based usages of the bot).build_numbersset to a submapping of project names to build number tracker details.nameset to the name that appears in theplugin.yml.jenkins_jobset to the Jenkins job name.regexset to a RegEx matcher, with one capturing group to capture the build number from a larger version string.max_behindset to an integer, representing how many builds behind one can safely be before a warning symbol should be displayed.
acceptable_server_versionsset to a list of server MC versions (just the main version without sub-version, like "1.15", not "1.15.1") that are acceptable + tracked (older = outdated, newer = unknown).additional_meta_sourcesset to a list of additional meta source URLs (should be direct zip links, likehttps://github.com/DenizenScript/Denizen/archive/dev.zip).reload_webhooksset to an optional list of URLs to set a POST request to when reloads are triggered.rss_feedsset to an optional submap of RSS feeds, with keysurl(direct rss.xml link),channels(list of channel ids), andcheck_rate(in minutes, decimals allowed)slash_cmd_versioncan be incremented to force a slash command re-registration at next startup
 
config.fds sample text content (the channel IDs are the actual ones on the Denizen Discord group):
valid_channels:
# denizen-lobby
- 315163488085475337
# bot-spam
- 315616018846318593
info_replies:
    new,newb,noob,newbie: Welcome new user! Please read the rules at the bottom of the #info channel, and feel free after that to ask for help in the most relevant channel!
url_base: https://meta.denizenscript.com/Docs/
command_prefix: !
project_details:
    Denizen:
        update: Latest **Denizen** dev builds are at <https://ci.citizensnpcs.co/job/Denizen_Developmental/>.\nLatest Denizen stable release builds are at <https://ci.citizensnpcs.co/job/Denizen/>.\nSpigot release of Denizen are at <https://www.spigotmc.org/resources/denizen.21039/>.
        github: https://github.com/DenizenScript/Denizen
        icon: https://i.alexgoodwin.media/i/for_real_usage/ec5694.png
channel_details:
    315163488085475337:
        updates: denizen spigot
        docs: true
rules:
    all: Here's all the rules though!
    1: This is an important rule!
build_numbers:
    denizen_release:
        name: Denizen
        jenkins_job: Denizen
        regex: [\d.]+(?:-SNAPSHOT)? \(build (\d+)-REL\)
        max_behind: 2
acceptable_server_versions:
    - 1.15
reload_webhooks:
- https://example.com
rss_feeds:
    f1:
        url: https://example.com/rss.xml
        channels:
        - 123456
        check_rate: 5
slash_cmd_version: 0
To start the bot up:
- Run 
./start.shwhile in the bot's directory. 
To view the bot's terminal:
- Connect to the screen - with an unaltered 
start.shfile, the way to connect to that is by runningscreen -r DenizenMetaBot. 
The MIT License (MIT)
Copyright (c) 2019-2024 The DenizenScript Team
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.