Skip to content

Commit

Permalink
Merge pull request #59 from C0casio45/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
C0casio45 authored May 12, 2022
2 parents b75c0ee + 2d46f08 commit cae5c1c
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 41 deletions.
10 changes: 5 additions & 5 deletions bot_modules/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ const { logs } = require("../config.json");

module.exports = {
execute: async function (client) {
const netinq = await client.users.fetch("248069530381844481");
if (!logs) return;
client.application?.fetch().then(() => {
client.application?.fetch().then(async () => {
const cocasio = client.application?.owner;
const netinq = await client.users.fetch("248069530381844481");

const fs = require("fs");

Expand Down Expand Up @@ -130,10 +130,10 @@ module.exports = {
});
},
log: async function (message, client) {
const netinq = await client.users.fetch("248069530381844481");

client.application?.fetch().then(() => {

client.application?.fetch().then(async () => {
const cocasio = client.application?.owner;
const netinq = await client.users.fetch("248069530381844481");

cocasio.send(message);
netinq.send(message);
Expand Down
10 changes: 10 additions & 0 deletions bot_modules/unban.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const db = require("../utils/db/dbLibrary.js");

module.exports = {
unban: function (interaction) {

let ub = interaction.customId.split(" ");
db.unbanUser(ub[0], ub[1])

}
}
24 changes: 0 additions & 24 deletions bot_modules/unbanFunction.js

This file was deleted.

6 changes: 5 additions & 1 deletion button/unban.js → button/deprecatedUnban.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const { MessageActionRow, MessageButton } = require('discord.js');
const { deprecate } = require('util');
const db = require("../utils/db/dbLibrary.js");

module.exports = {
name: 'unban',
description: "Méthode Enregistrer qu'un utilisateur a bien été débanni",
execute: function (interaction) {

/**
*
* @deprecated
*/
let ub = interaction.customId.split(" ");


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions commands/ban.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const db = require("../utils/db/dbLibrary.js");
const dp = require(`../bot_modules/deploy.js`);

const { mp_sanction_buttons } = require("../utils/buttons/mp_sanction_buttons");
const { mp_loop_buttons } = require("../utils/buttons/mp_loop_buttons");
const { mpSanction } = require("../utils/buttons/mpSanction");
const { mpLoop } = require("../utils/buttons/mpLoop");
const faceit = require("../bot_modules/faceit.js");

const Message = require("../utils/embeds/MessagesLibrary");
Expand Down Expand Up @@ -93,7 +93,7 @@ module.exports = {
msg.channel
.send({
embeds: [Message.requestBanDuration(pseudo)],
components: [mp_sanction_buttons()],
components: [mpSanction()],
})
.then(async (rmsg) => {
listenDay(i, liengame, rmsg, pseudo);
Expand Down Expand Up @@ -154,7 +154,7 @@ module.exports = {
msg.channel
.send({
embeds: [Message.requestOtherBans(array.length, array)],
components: [mp_loop_buttons()],
components: [mpLoop()],
})
.then(async (rmsg) => {
rmsg.channel
Expand Down
4 changes: 2 additions & 2 deletions utils/buttons/mp_loop_buttons.js → utils/buttons/mpLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ const button_close = () => {
.setStyle("DANGER");
};

const mp_loop_buttons = () => {
const mpLoop = () => {
return new MessageActionRow()
.addComponents(button_continue())
.addComponents(button_close());
};
module.exports = {
mp_loop_buttons,
mpLoop,
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const button_perm = () => {
.setEmoji("🚨");
};

const mp_sanction_buttons = () => {
const mpSanction = () => {
return new MessageActionRow()
.addComponents(button_avertissement())
.addComponents(button_perm());
};
module.exports = {
mp_sanction_buttons,
mpSanction,
};
6 changes: 3 additions & 3 deletions utils/embeds/MessagesLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class Message {
return new MessageFactory(content);

function textBuilder(ban) {
if (ban[1] == 99999) return "ban permanent";
if (ban[1] == 0) return "averti";
return `banni pendant ${ban[1]} jours`;
if (ban == 99999) return "ban permanent";
if (ban == 0) return "averti";
return `banni pendant ${ban} jours`;
}
}

Expand Down

0 comments on commit cae5c1c

Please sign in to comment.