Code Monkey home page Code Monkey logo

Comments (11)

IanMitchell avatar IanMitchell commented on July 16, 2024

Some additional notes - we'll probably need a new messaging utility. Something like

prompt('input string').then(response => ... ).catch(err => ...);

Which queries the server admin and resolves with their response. The user can respond cancel to stop the process, which throws the error that the module keys off of to clean up any activity.

We'll also want an optional setUp method per command that can prompt for keys or other such information. This can be used as an temporary whitelist/blacklist system as well, until a better one can be devised (just exporting an array of IDs?)

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

The setup method should probably be a promise as well; the core bot can key off of a resolve to finish adding the module or a reject to send an error message. At this point, it might be prudent to switch the command files to a class system in a similar fashion to ARX-7

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

Once this is done, we should bump up the version to 1.0 and release it on NPM

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

Thinking the following format might be best - maybe rename setUp to addServer?

class Command {
  constructor() {
    this.name = 'Command';
    this.serverWhitelist = [];
    this.serverBlacklist = [];
  }

  setUp() {
    return;
  }

  message() {
    return false;
  }

  helpMessage() {
    return;
  }
}

module.exports = Command;

I made helpMessage a function because I think having the option to specialize it per server is nice; for instance, you could rename "karma" to something else per server and have it reflect in the help message.

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

As part of this, we need a settings table - the Schema should probably look like:

id serverID command key value
x '3423...' 'karma' 'name' 'torneritos'

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

Actually, it might be worth combining key/value into a single config JSON field

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

I think this might require a few extra database tables; it might be worth reorganizing what we currently have.

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

Progress update: Settings and conditional command loading work. I've gotten an initial admin query system up that allows them to set config values, but I still need to add/remove all commands, clear up the messaging a bit, and clear set config values. The permissions system also isn't exposed to the admin yet

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

Alright, status update - everything is done except for:

  • Update Karma to read from settings
  • New server created message
  • Create admin command to automatically create Aquarius Roles

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

Issues found:

  • After adding all commands, a help displays an empty list of available commands
  • Karma is broken (try to retrieve when none is set, the settings is broken when you try to increase)
  • Help not displayed for all commands (module not found)

from aquarius.

IanMitchell avatar IanMitchell commented on July 16, 2024

Done and merged in 8256f76

from aquarius.

Related Issues (20)

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.