项目作者: maxrumsey
项目描述 :
A Discord Bot for democratic community servers.
高级语言: JavaScript
项目地址: git://github.com/maxrumsey/Democracy.git
Democracy Bot
What is Democracy Bot? Democracy Bot is a bot that aims to make Discord Servers more democratic and transparent through allowing anyone to submit rules to be voted on.
Commands
- d!setChannel
Set the channel where the bot posts rules or votes. [Admin Use Only]
d!setChannel #channel
eg: d!setChannel vote #vote_for_rules_here - d!setConfig
Change a configuration value. [Admin Use Only]
d!setConfig - d!setup
Setup and configure the bot for first-time use. [Admin Use Only]
d!setup - d!listConfig
List the configuration of the current server.
d!listConfig - d!wipeRules
Wipe and delete all the currently active rules. [Admin Use Only]
d!wipeRules - d!about
View information about the bot.
d!about - d!debug
Debug the bot incase it is not working.
d!debug - d!help
View this help document.
d!help - d!ping
Pings the bot.
d!ping - d!eval
Eval a command. [Owner Use Only]
d!eval
eg: d!eval console.log(1); - d!createBill
Create a bill for a new vote.
d!createBill - d!listRules
List the currently approved rules.
d!listRules - d!delete
Delete a rule. [Admin Use Only]
d!delete vote_id
eg: d!delete 198 - d!veto
Approve or deny a rule. [Admin Use Only]
d!veto vote_id
eg: d!veto deny 198 - d!forceRule
Instantly add a rule. [Admin Use Only]
d!forceRule
How to get started with the bot
- Invite the bot
- Set the channels where votes and rules are published:
d!setChannel vote/rules #channel
- Optional: If required, change configuration values with the command:
d!setConfig
Vote Statuses:
In the database, the status of a vote is referred to with an integer from 0 to 5. Each number corresponds to a differnet status.
- 0: In progress (A newly created vote)
- 1: Denied (Not approved in the voting process)
- 2: Approved (An approved vote for the creation of a rule)
- 3: Obsolete (An approved vote for the amendment / changing of a rule)
- 4: Deleted (Deleted by an administrator)
- 5: Error-Causing
Selfhosting
Selfhosting Democracy Bot is easy. It requires a MySQL database running.
- Clone the repository:
$ git clone https://github.com/maxrumsey/Democracy
- Install dependencies:
$ npm install
- Copy and Fillout the ENV template below:
nano .env
- Run the bot with
$ node bot.js
Example .env:
TOKEN=YOUR.DISCORD.BOT.TOKEN
DB_HOST=127.0.0.1
DB_USER=root
DB_PASSWORD=admin1234
DB_NAME=democracy
OWNER=YOUR.DISCORD.USER.ID
DBLAPI=DiscordBotListAPIToken