This project is Multi-purposed Bot for Discord. Highly inspired in yui.
- Git
- node.js v10.x or Higher
- Discord Bot Token & Client ID
- MongoDB Server (For Emoticon Database)
# clone project
git clone https://github.com/Hazealign/black-angus-bot.git && cd black-angus-bot
# install dependencies
npm install # (or yarn)
# write configuration file
mkdir env; vi env/config.json
# start black-angus-bot
CONFIG_FILE=./env/config.json npm start
IConfiguration.ts
's Interface is Configuration file's scheme. Here's the description of each configs.
Type: Boolean
Send Debug Message to DEBUG_HISTORY_OR_ERROR_CHANNEL
Discord Channel. Bot still emit debug log to console if this flag is false
.
Send Error(Title, Stacktrace) Message to DEBUG_HISTORY_OR_ERROR_CHANNEL
Discord Channel. Bot still emit error log to console if this flag is false
.
Type: String
Discord Channel Name to save logs(Error / Debug). Text Channel Only. Caution: Do not put '#' in prefix.
Type: String
Put your Discord bot's Token.
Type: String
Put your Discord bot Application's Client ID.
Type: String
Put your MongoDB Database Server's Address.
Type: Boolean
If this config is false, Emotion-related features will not work.
Type: String
Folder Path where emoticon images will saved. It must be an absolute path. If this directory not exists, Bot will try to create folder.
When bot starts, bot tries to imports every JavaScript / TypeScript files in src/commands
folders.
- Make a Class which implements
ICommand
interface. - Put a Decorator
@CommandDefinition()
in 1's class. It'll be registered in command list.
// example
import { CommandDefinition } from '../core/CommandFactory'
import { ICommand, CommandType } from '../core/ICommand'
import { Message } from 'discord.js'
import { BOT_CONFIG } from '../configs/IConfigurations'
@CommandDefinition()
export class Invitation implements ICommand {
type: CommandType = CommandType.ADMIN_COMMANDS
prefix: string = '!'
async action (context: Message) {
const { content, channel } = context
if (content.indexOf('초대') === -1) {
return
}
await channel.send(
'https://discordapp.com/oauth2/authorize?' +
`client_id=${BOT_CONFIG.DISCORD_CLIENT_ID}` +
'&scope=bot&permissions=201444416'
)
}
}
black-angus-bot
project follows MIT License.