Skip to content

Releases: Ratot-Team/Ratot

V0.6.0

01 May 17:46
a4e2d0c
Compare
Choose a tag to compare
  • Changed the structure of the code:

    • Separated the commands on different category folders.

    • Separated each event code to separate folders.

    • Created a folder "utils" to put all the extra reusable code.

    • Created a folder to keep all the api code.

    • Created a folder to keep all the handlers code.

  • Changed all the old commands to slash commands.

  • Added an anonym option to all the commands

  • Added a validation to check in some commands if the command came from a private message because of incompatibilities.

Ratot V0.5.0.1

04 Apr 00:53
d052e91
Compare
Choose a tag to compare

News

  • Now the bot is callhed Ratot and has a new avatar!
  • Changed the bot name from "Λce" or "Ace" to "Ratot" and updated the repository name and the github organization names.
  • Changed the donation websites name too.
  • Change the images on the embeds and the colors to match the new avatar and the new bot design.

Changes

  • Fixed the issue on the "$add admin" command by changing the way the bot verifies if the user mentioned to add as an admin is correct, now it filters the string only for numbers and tries to search for his username, if it fails it warns the users saying that the given user didn't exist.
  • Organized some code.
  • Changed the name of the bot on the LICENSE and updated the year
  • Deleted the Procfile because it's not used anymore.
  • Added verification to the "$add admin" command
    • Now it's verified if the bot can send a private message to the user and if not sends a reply saying that user can't be reached.
  • Modified the way the bot interprets the mention of the user to add as admin or remove.
  • Modified some Portuguese text forgotten on the code to English.

Λce V0.5.0

05 Feb 01:43
dec3d97
Compare
Choose a tag to compare

Major New Updates

  • Changed the bot name from "Ace" to "Λce".

  • Updated Discord.js library to the version 13

    • Edited the logic to create the Discord client instance because now it's required to give the intents the bot will use

      • Old logic:
      const Discord = require("discord.js");
      const client = new Discord.Client();
      • New logic:
      const { Client, Intents, Permissions } = Discord;
      const client = new Client({
         intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
      });
    • Edited all the channel.send("message text or embed") and message.reply("message text or embed") functions responsible for sending/replying messages with the bot, because now that commands need an options object with the content or embeds the bot should send.

      • Example:
      channel.send({
          content: "Message",
          embeds: [embed],
      });
      message.reply({
          content: "Message",
          embeds: [embed],
      });
    • Edited the logic used to verify permissions:

      • The used logic was:
      member.hasPermission("PERMISSION")
      • The new logic is:
      member.permissions.has(Permissions.FLAGS.PERMISSION)
    • Edited the logic to delete a message after a certain time (temporary message).

      • The used logic was:
      message.reply("message text or embed").then((message) => {
          message.delete({ timeout: 5000 });
      });
      • The new logic is:
      message
        .reply({
            content: "message text",
            embeds: [optionalEmbeds],
        })
        .then((message) => {
            setTimeout(() => message.delete(), 5000);
        });
    • Edited all the logic that used the function .catch() and used a try and catch instead.

      • Old logic:
      something.someFunction(someParams).catch(errorLogger.error);
      • New logic:
      try {
          something.someFunction(someParams);
      } catch (error) {
          errorLogger.error(error);
      }

    (all the changes on the code to make it compatible with the version 13 were made based on this article)

  • Added bot administrators

    • Added logic to add and remove bot administrators. The bot administrators can change some bot settings and can make some special commands.

      • When a new user is added as a bot administrator, the bot sends him a private message informing him, and sends him a list of all the commands he can do as a bot administrator.
    • Commands added:

      • $add admin <@someone> - adds an admin to the bot database.
      • $remove admin <@someone> - removes an admin from the bot database
  • Added a logic to rerun the bot everytime it goes down because of some error.

    • Now all the bot code on the main.js file is inside of the function:
    if (cluster.isWorker) {
        //all the code of the bot is here now
    }
    • Added a function to verify if the worker (the worker is the process where the bot is running) exits for some reason and then logs an error and rerun the code again.
    cluster.on("exit", function(worker, code, signal) { //This code is runned by the master (that is the process father of the worker)
        errorLogger.error(
            "ERROR"
        );
        cluster.fork(); //Rerun the code
    });
  • Added Yarn as the main package manager

  • Added the command to show the list of servers where the bot is.

    • Command added: $list servers

  • Added the command to list all the channels on the server from which the message was sent, but if the user gives an id the bot shows all the channels from the server with that id, if the bot is in that server.

    • Command added: $list channels <optional server id>

Enhancements

  • Edited the command that changes the status of the bot to verify if the user calling it is an administrator and not only the creator.

Fixes

  • Added a new verification for the delete messages command. Now it verifies if the user has the "MANAGE_MESAGES" permission instead of the "ADMINISTRATOR" and it verifies if he has that permission either on the channel or the entire server.

    • Old code:
    if (message.member.permissions.has("ADMINISTRATOR")) {}
    • New code:
    if (
        message.member.permissions.has(Permissions.FLAGS.MANAGE_MESSAGES) ||
        message.member
          .permissionsIn(message.channel)
          .has(Permissions.FLAGS.MANAGE_MESSAGES)
    ) {}
  • Added some logic to the add admin command to prevent the user to add the bot as itself administrator.

  • Changed the client.on("message") funtion to client.on("messageCreate") because the message event was deprecated

  • Added the verification of the bot permissions to delete messages, so that the bot doesn't throw an exception when asked to delete messages and it doesn't have the permissions.

  • Added a logic to the delete messages command to only delete messages newer than 14 days, because the Discord.js API doesn't let the bulk deletion of messages older than 14 days.

  • Added permissions verifications to the change prefix command so that only admins can change the prefix of the bot.

Minor New Updates

  • Added a FUNDING.yml to the repository responsible for making appear the sponsor button where anyone can contribute to this bot development.

  • Edited the LICENSE just to change the name of the creator from IIIRataxIII to Captain Ratax

  • Removed everything about the writing of the pid of the process on a file that should be used by the Ace Bot Auto Deploy program.

  • Edited some environment variables. Now the token used by the bot is the "ACE_BOT_CURRENT_TOKEN" and added the variables "DBURL_PROD" and "DBURL_DEV" to have all the tokens and urls saved and change them when wanted.

  • Added some logic to verify if the creator is already on the database as a bot administrator every time the bot executes for the first time

  • Removed everything about the special command (it was only used for one server).

  • Added some logic to the command change status so that now it can be called with "$cs".

  • Added a warn message when a new administrator is added or removed from the database.

  • Used Prettier to make the code more organized and clean.

  • Added to the README.md file all the admin commands.

  • Removed all the functions that replaced all the console.log/.warn/.err by the custom loggers.

  • Added a new dependency to make paginations in the embed messages.

  • Added cmd.exe to the .gitignore file.

  • Changed all the dates from the bot to show the current year instead of a static one and changed the years on the LICENSE file.

  • Added a new variable on the .env file to save the bot name.

Ace V0.4.0

16 Aug 21:17
41fc5b1
Compare
Choose a tag to compare

News

New commands

  • $prefix <prefix> (or $p <prefix>)
    Change the prefix for the bot commands.

All New Features

  • Created a BD and all the logic behind it to save configs and other types of necessary information.
  • Created a logger that log everything on the running console and save it on separated files by type and day.
    • Info type - logs that contain normal information about tasks realized by Ace.
    • Warn type - logs that contain important warning information, like when a setting is changed by an admin.
    • Error type - logs that contain all the errors that occurred.
  • Added "Try and Catch" everywhere on the code so that when one error occurs it doesn't stop all the code and just log it and continues working.
  • Created an express.js server to expose an API to run specific commands in the future.
  • Created a command to change the status of the bot. (not on the wiki neither the readme because it's an admin only command).
  • Created a command to change the prefix of the bot on the specific server where it's called.
  • Created a logic to start and stop the bot so that the Automatic Ace Deploy program can use it to deploy the newest version of the Ace every time it changes.

Others News

  • Created an organization on github to own the Ace.
  • Changed the license from MIT to GPLv3

Ace V0.3.4

07 Jun 20:05
9765ffe
Compare
Choose a tag to compare

News:

  • Added a validation to the special command to only accept requests from the special server:
    • Add a server validation to the special command to verify if the message came from the special server and not from other servers.
  • Fixed a bug in the special command with some variables:
    • The special command had a problem with the variable timeInMiliseconds and the args[3] that lost their value the next time the timer was executed because they were local function variables and when the bot got out of that functions the variables lost their value. The solution was to change the function local variables to global ones.

Ace V0.3.3

05 Jun 00:32
0fbf9af
Compare
Choose a tag to compare

Just a version with an addition to a special thing for a special server

Ace Bot V0.3.2

19 May 22:11
8e0df83
Compare
Choose a tag to compare

Fixed all the issues from codacy to get a cleaner code. Now the bot has an A grade on code quality!

Ace Bot V0.3.1

19 May 18:43
01efd8c
Compare
Choose a tag to compare

Bug Fix

The bot was using the development token instead of the original one and that was changed with this release

Ace Bot V0.3.0

19 May 18:12
de2a54e
Compare
Choose a tag to compare

News!

  • Now dotenv is used to save all the important and confidential data from the code.
  • The bot language changed from Portuguese to English.
  • All the bad words off some commands have been changed to nicer words.
  • All the commands were moved to the "commands.js" file.
  • All the code was commented.
  • The "hug" command has improvements.
    • Changed the way the hug command tells the bot to hug itself (changed the static bot mention value to a dynamic one).
    • Added a way to the bot hug the same person that calls the command if the person mentions itself (and changed the help command to mention that).
  • Some documentation has been added.
    • Added a Wiki.
    • Added a README file.
    • Added a LICENSE file.
  • All the static "$" has been changed to use the dynamic prefix variable.
  • Added an isDevMode boolean that changes if is used the Ace Dev or the Ace.
  • Added a currentBotDiscordId that saves the discord id of the bot.
  • Added nodemon to the dependencies.

Rat.exe Bot V0.2.1

23 Sep 17:04
ae34101
Compare
Choose a tag to compare

Novidades!

  • Correção de um erro no comando $abraçar que permitia que usassem o comando mesmo quando o que escreviam à frente não era uma menção de ninguém.