Giter Site home page Giter Site logo

usami's Introduction

Usami

This is a bot that does a few bits and pieces for personal use but you can use it too if you want. It's structured so that the configuration file defines the available commands (and available replies to things people say), and only works in servers that have been whitelisted by an admin.

Also, in Legacy Lua Bot there's a bot written in C++ that runs lua stuff. It runs on an old version of SleepyDiscord so don't expect to be able to get it working, but the code is there for the sake of it

Available Commands

Usami will search for .js modules in the commands folder. The ones I've implemented are as follows:

/stats

Rolls ability scores for 5e Dungeons & Dragons using the 4d6kh3 formula.

/xp add

Adds XP to a global count.

/xp show

Shows the global XP count.

/remind {time period} {what to be reminded of}

Pretty simple. Ask for something to be reminded in minutes, hours, days, weeks, months, or years.

Admin Commands

To use any of these you need to have your id in the admins field of config.json.

/admin server add

Whitelists the server the command is used in.

/admin server remove

Blacklists the server the command is used in.

/admin reload

Reloads data.json.

/admin save

Saves config.json and data.json.

Setup

To use, make a file called config.json in the same directory as main.js that looks like this:

{
    "token": "your token here",
    "admins": [
        "your user ID here"
    ],
    "servers": [],
    "macros": [
        {
            "name": "boop",
            "trigger": "boop",
            "reply": "boop",
            "atStartOnly": true,
            "requireSpace": false,
            "caseSensitive": true
        },
        {
            "name": "hug",
            "trigger": "/hug",
            "reply": "༼ つ ◕_◕ ༽つ",
            "atStartOnly": false,
            "requireSpace": false,
            "caseSensitive": false
        },
        {
            "name": "bot",
            "trigger": "bot",
            "reply": "been here all along :eyes:",
            "atStartOnly": false,
            "requireSpace": true,
            "caseSensitive": false
        }
    ]
}

For the macro stuff, you need to have all 6 fields as demonstrated above. requireSpace means there must be spaces surrounding the trigger (or it's at the start or end) in order for it to work. The other booleans should be self-explantory. The name field is used for generating a slash command for the replies.

You also need to make a file called data.json that looks like this:

{}

Then just run with node main.

Dependencies

  • discord.js (npm install discord.js)

usami's People

Contributors

relick avatar hanhmchau avatar

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.