Code Monkey home page Code Monkey logo

hotbot's Introduction

Hotbot version 5.0.4

What is hotbot?

At a glance, Hotbot is a discord bot built specifically for a programming server. It has many features, including fun, administration, channel management, an internal permissions system as well as some forms of anti-spam.

User manual

This is TBD, since currently the only user of it (really) is the creator of this project -- that being said there will be a full end to end manual done in readthedocs, github pages or something similar to accommodate for people who want to set up their own instance. Please note, hotbot at this moment in time is a single server bot, this means that you will get unexpected behaviour if you run it on more than one guild. Multi-guild may come in 6.x.x but for now it is a far away feature.

Developer documentation
  • This bot depends primarily on JDA, you can find a link to JDA here
  • In order to build the project, you will need maven installed. You can view more about maven here
  • Full documentation will be available later of the DSL's created and some of the other features seperated from the commands. Commands are by in large self-documenting.
Using the JavaScript API

You can add new commands and features to this bot yourself without recompiling. You can do this by writing some simple JavaScript; this should be quite easy to do if you know how to code.

Requirements
What the API exposes

The api exposes a few things:

  • The JDA object. You can use it like the JDA object found here https://github.com/DV8FromTheWorld/JDA
  • The commands container (Useful for implementing commands)
  • The configuration object (For grabbing any configuration information)
A basic command

Read the JavaScript code below (Please note, ES 5.1 syntax for now):

//create a command object. The command will be invoked by typing (prefix)jsecho
var command = createCommand("jsecho")

//state that in order to use the command, the user must provide some arguments, e.g. ++jsecho Hi there, this is a test!
command.expect(argType.Sentence)

//Provide a function that is called when the command is executed (It is passed a CommandEvent)
command.execute( function(event) {
    //Get the first argument out of the argument array.
    var arg1 = event.args[0]
    //respond to the channel that this command was called in with what they said
    event.respond(arg1)
});

Sample output:

++jsecho test
Bot: test
Where do I put the code?

In config/scripts/custom. This directory may not exist, create it.

More documentation to come!

Contributing
  • Keep pull requests small and easily digestable, stick to one feature or one atomic change within the project.
  • If you are going to submit a feature PR, make sure that you ask me if I want it in the bot first, since if I don't want it, it won't end up in the bot, and you will have wasted your time (potentially, maybe you can still use it?)
  • Try to keep commits somewhat atomic, if you need to make a feature which requires various changes to the code base, try to commit each of these individually.

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.