Code Monkey home page Code Monkey logo

chronos's People

Contributors

andreybest avatar calcium3d avatar codevenkat avatar d1vshar avatar dfirebird avatar itsazaria avatar lima0 avatar moni-dz avatar ridays2001 avatar sidtr0 avatar woojiahao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chronos's Issues

Config system

A lot of commands will be saving config to a flat json file. We need some kind of config system to make that all possible.

things that will be saved in there are: current slowmode per channel, current prefix.
Attention should be taken here to assure that if needed the config can be multi guild. I suggest a json file with this format to start with, extra fields may be needed in the future

  "botOwner": 345541952500006912,
  "guildConfigurations": [
    {
      "guildID": 699595207720566824,
      "logChannel": 735931902359502888,
      "prefix": "+",
      "staffRole": "staff_role_name",
      "slowmodeChannels": [
        "735931902359502888": 1800,
        "757602062241497189": 2400
      ]
    }
  ]
}

Refactor: getGuildConfig()

  • Currently, when we want to get the saved guildConfig for a guild, we use different ways and it's inefficient.
  • Your task is to build a clean function that accepts Guild or guild ID as input and return undefined or the guild config object depending on whether it's present or not.
  • Put the file in src/utilities/ folder.
  • While you're at it, replace all instances of guildConfigurations with your newly created function.

Fix: slow mode command

  • The slow mode command doesn't work when used without any time units.
  • Fix the time argument and prompt accordingly.

Feature to automatically adjust slowmode

This should take into account the config for slowmode thresholds in the config and use a timer, or perhaps a clever implementation using some kind of EvictingQueue and looking at the messages creation date

Fix: bot owner

  • We've made bot owner configurable. But, we haven't actually implemented it.
  • The task is to replace all instances of process.env.OWNERID with the botOwner that is in the config file.
  • Make sure that you don't break the code.
  • Use botOwner instead of the current BotOwner because we need to stick to camelCase.

Fix: inhibitor bug

  • The inhibitor disables access by default. (Because there will be at least one entry in the config file).
  • Set the default to guild admin message.member.permissions.has('ADMINISTRATOR') or bot owner this.client.isOwner(message.author) if there are no stored configs for the guild.
  • If you return true it'll block the command from being run (inhibit it).
  • While you're at it, try to clean up the code, if possible.

Fix: config file

  • Some of the IDs are parsed and stored as numbers, while the others are stored as strings. The API directly provides strings, so it's better to convert all of them to strings.
  • The BotOwner is in the title case. But, we are using camelCase rename all instances of it.
  • The indentation of the config.json file is messed up. Needs fixing.

A mention embed

image
so a lot of bots have this mention -> info embed. Would be very useful for gathering all that information in one place (removes the need for a ping and uptime command)

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.