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 like
git submodule update --init --recursive.
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. The
screenprogram 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 12345where
12345is 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 file
token.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://discord.foxbot.me/docs/guides/getting_started/intro.html (ignore the coding parts, just follow the first bits about creating a bot user on the Discord application system, and getting the token).
- Within the
configdirectory, create file
config.fds(a FreneticDataSyntax file) with the following options (See also the full file text sample below):
valid_channelsset to a whitelist of channels the bot responds in (blank = 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 the
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.
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://one.denizenscript.com/denizen/ 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\)
To start the bot up:
./start.shwhile in the bot's directory (You made need to run
chmod +x ./start.shfirst).
To view the bot's terminal:
- Connect to the screen - with an unaltered
start.shfile, the way to connect to that is by running
screen -r DenizenMetaBot.
The MIT License (MIT)
Copyright (c) 2019 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.