A discord bot build with node.js
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
Trivernis 2a2f4abe66 Modifications
- replaced most promises with async/await
- added sqlite3 session storage
- restyled login page
- added session requirement to graphql
- deactivated incompatible
- modified mockobjects
- added fs-extra for async file operations
6 years ago
.circleci Fixed CircleCi configuration 6 years ago
commands Modifications 6 years ago
lib Modifications 6 years ago
test Modifications 6 years ago
web Modifications 6 years ago
.gitignore Restructured Tests 6 years ago
LICENSE Create LICENSE 6 years ago
README.md Changes to webservice 6 years ago
bot.js Modifications 6 years ago
package.json Modifications 6 years ago
renovate.json Add renovate.json 6 years ago

README.md

discordbot License: GPL v3 CircleCI CodeFactor

A bot that does the discord thing.

node bot.node [--token=<DiscordBotToken>] [--ytapi=<GoogleApiKey>] [--owner=<DiscordTag>] [--prefix=<Char>] [--game=<String>] [-i=<Boolen>]

The arguments are optional because the token and youtube-api-key that the bot needs to run can also be defined in the config.json in the bot's directory:

// config.json
{
  "prefix": "_",
  "presence": "STRING",   // this will be shown when no presences are set in data/presences.txt
  "presence_duration": 300000,  // how long does the bot have one presence
  "api": {
    "botToken": "YOUR DISCORD BOT TOKEN",   
    "youTubeApiKey": "YOUR YOUTUBE API KEY"
  },
  "owners": [
    "DISCORD NAME"  // specify a list of bot owners that can use the owner commands
  ],
  "music": {
    "timeout": 300000
  },
  "webservice": {     // optional
    "enabled": true,  // enable the server
    "port": 8080,     // set the port
    "graphiql": false // switch the graphiql interface on/off
  }
}

If the keys are missing from the config file, the bot exits. This behaviour can be deactivated by setting the -i commandline flag. You need to generate an api-token to access the graphql webservice. You can generate one with the owner-command tokengen uses via PM.

Keys

You can get the API-Keys here:

Discord Bot Token

YouTube API Key

Features

At the moment the bot can...

  • ...play music (YouTube videos and playlists)
  • ...save songs/playlists with a given name
  • ...log stuff in a database
  • ...transform into a cow

Presences

You can add presences to the bot either by owner command addpresence or by providing a presences.txt file in the data directory. Each line represents a presence.

When all lines are loaded by the bot, the file gets deleted.

Ideas

  • command replies saved in file (server specific file and global file)
  • reddit api
  • anilist api
  • othercoolstuff api