GithubHelp home page GithubHelp logo

jameslongman / ava-discordbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 99 KB

NON FUNCTIONING, Ava is an open-source general purpose discord bot written in node.js with the discord.js library

License: MIT License

JavaScript 99.25% Shell 0.75%

ava-discordbot's Introduction

This bot is currently in development and not very functional

Coverage Status

About

Ava is an open-source multi-server general discord bot, the bot is built using node.js with the discord.js API library.

The main purpose of Ava is to provide example code from which you may build your own bot. Ava's code is designed with modular programming in mind so isolating the code for one particular feature should hopefully not be too difficult.

Ava is designed to run with:

  • Multi-server support
  • Integration with a MySQL database
  • Production, staging and development environments powered by Docker
  • CI tests run by Travis

Ava's features (Customisable, features can be disabled and enabled for your server):

  • Multiple commands (list below)
  • Automatic moderation
  • Admin commands
  • Server member statistic tracking

The Ava project complies with community best practices for discord bots

Code usage

The Ava bot is developed open-source under the MIT license, feel free to use the entire code or sections however you like with attribution.

Installation for devs

If you are able to run Docker then running Ava is as simple as cloning the repository, customising your local git ignored configs, then running docker-compose up --build in the project directory

However if you are not able to run Docker you can also run the bot manually by running the lib/ava.js script in node. Please however note this will require:

  • Node.js 6.0.0 or higher
  • package.json dependencies
  • Python and node-gyp build tools (if you're on windows you can use "npm install -g windows-build-tools" when running your CLI as admin)

ava-discordbot's People

Contributors

jameslongman avatar

Watchers

 avatar

ava-discordbot's Issues

Create project website with advanced guides of all commands/features

Even though "%help (command/feature)" goes very much into depth if people need it. There will always be some people who need a little bit more help who could be directed to a bot guide on the project's website with very in depth guides for each command and feature.

This will need to be created before work can begin on V2 (bot dashboard)

Add MCS (Modular Channel System)

A feature I wrote on a previous discord bot that I was very happy with and was very popular was the Modular Channel System (MCS), this may become depreciated soon as discord is introducing sub-channels but it depends how their feature turns out.

The MCS creates voice channels as needed and expands to accommodate growth, when enabled it works by the naming of participating voice channels. A channel named WOW/Raid/1 for example will act as a base channel where the /1 denotes a MCS channel. Upon someone joining it WOW/Raid/2 is created, if someone joins that WOW/Raid/3 is created, if there is ever more than one MCS channel empty then the greater one is deleted.

I've not seen any other bots possess a feature akin to this so I think it would be great to include this in V1

Add SFX command

Using %SFX (sound effect name) will have Ava respond with a sound effect in your channel. Sounds effects should be short humorous 10 second clips

discord.js voice features up to v11 are very unreliable though and I have heard that v12 of the library will hopefully come with a more stable system so I will postpone the feature until either the v12 release, or when the project develops to the point that it makes more sense to implement the feature even if it might need to be rewritten

Set up a database with intergration

The bot will require a database to function to its full ability across multiple servers. This could possibly be handled by something like SQLite

Add some basic commands

A few good basic commands to get started would probably be:

  • %help (list basic bot info or more detailed help with any command/feature)
  • %ping (classic pingtime command)
  • %commands (PM user with a list of commands)
  • %prefix (Sets command prefix for a server)
  • %features (Post enabled/disabled features in the channel)
  • %cats (post random cat picture in the channel)
  • %botStats (Bot information and statistics)
  • %github (Interested in the bot's code? Link to github)
  • %invite (Posts a link that can be used to invite the bot to your server)
  • %commandschannel (set ava to only respond to commands posted in one channel)

Create a leveling system

A cool feature of some of the more advanced bots is the ability for users to earn points and level up on a server. A few joke commands could be unlocked as a reward for reaching higher levels. A big feature and not strictly necessary for V1

Allow automatic role assignment

A feature I have implemented previously on another bot was automatic role assignment where the bot would detect someone playing a certain game and automatically assign them the role for that game. Implementing this on a multi-server bot will certainly be more difficult and easier with a dashboard but it's not impossible through commands. Very few bots have this feature so I would like to include it in the V1 release

Set up logger for project

There will need to be some form of logging control for the project, this can either be custom built or use some sort of library like winston

Create a dashboard for the bot on the website

Create a dashboard on the website where it is possible to login somehow (maybe by linking your discord or inputting a code that the bot will PM to a server admin) where you can configure the bot's service on your server.

This is a very good feature only high end bots possess and would be a lot nicer for user experience than configuring complicated features than requiring very complicated text commands on discord

Lay groundwork for multi language support

Much further down the road at V3 I would like to implement support for languages other than english. Doing this would require:

  • A way to specify the language for your server via a command/dashboard section
  • All string indexes should not be hardcoded in modules, but moved to be referenced in a file depending on what language the server is set to
  • Languages could then be supported once all needed strings for the bot have been translated and placed in a language file that can be referenced

Have a comments pass before release

Before releasing V1 a pass should be carried out on all of the comments in the bot's code. One of the main aims of the project is to provide example code that can be easily adapted so it's very important that comments are very thorough and descriptive.

The comments in the testing code will not need to be held to such a high standard though as that section is just for maintaining standards of the Ava project

Create a docker-compose file to run a script for initial setup

The first time someone runs the project it would not be enough to simply start up the normal docker-compose. The database would have to be configured.

This could either be done through a startup check to create any tables and columns which were missing which might actually be easier as it wouldn't require another compose file, but unfortunately this woould have a significant impact on startup time. Or alternatively another docker-compose file could be created to create the tables needed before starting the bot (either via script or by creating another bot.js file and using the first method)

Add a moderation system

Add a system where certain roles can be set as moderator roles and given access to certain moderation abilities. This will be a complex system, for simplicity the first iteration should come with the ability to add roles to one of two moderation levels.

The first will come with basic kicking and timeout ability, the second level will also have the ability to lockdown channels, and ban members from a server.

All moderation actions can be logged in a channel of the server's choosing, admins will automatically have access to all mod commands

Implement basic antispam protection

For the protection of Ava (both in processing resources and the possibility of getting API banned) there should be a maximum threshold of commands that are responded to per server in any period of time. This doesn't need to be too low but if a server is making 20 request per minute or more for example then unless the server is absolutely huge they probably aren't legitimate requests.

To protect against possible missuse and attacks against both Ava and the servers the bot opertates on a basic antispam should be implemented

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.