Skip to content

Commit

Permalink
Ajout du support des émojis du bloc unicode bloc unicode "Symbole et …
Browse files Browse the repository at this point in the history
…pictogramme étendu A" (#7)

* correctif temps redirection

* oupsy fix du salon choisi comme sondage

* Support Symbols and Pictographs Extended-A to sondage

* sqlite no longer required

* salon_sondage dans le .env pour test plus facile

* fixing sondage

* remove console.log

* fix #8

* fix order

* retrait doublons + ordre + fix clear emoji

* set default value for salonSondage
  • Loading branch information
awing-ding authored Aug 23, 2024
1 parent 5c2b62d commit bf0fcd0
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 243 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ un bot discord simple pour le serveur discord AlterHis et uchronies
## Installation
assurez vous d'avoir la version 16.9 de node ou plus installée
assurez vous d'avoir npm d'installé
assurez vous d'avoir la version 3.6.19 de sqlite3 ou plus installée

créez et remplissez le fichier de configuration nommé .env
```
Expand Down
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { REST, Routes, PermissionsBitField, Events } = require('discord.js');
const utilities = require('./utilities');
require("dotenv").config();

const CHANNEL_SONDAGE = "522437669582667787";
const salonSondage = process.env.SALON_SONDAGE ?? "522437669582667787";

const { Client, GatewayIntentBits } = require('discord.js');
const myIntents = [
Expand Down Expand Up @@ -91,10 +91,10 @@ client.on("guildBanRemove", function(guild, user){
// this code is executed every time they add a reaction
client.on(Events.MessageReactionAdd, async (reaction, user) => {
var member = user.client.guilds.cache.get(reaction.message.guild.id).members.cache.get(user.id);
if (reaction.emoji.name == '🚩' && reaction.count >= 1 && member.roles.cache.some(role => role.id == utilities.roleMod ) ) {
if (reaction.emoji.name === '🚩' && reaction.count >= 1 && member.roles.cache.some(role => role.id == utilities.roleMod ) ) {
utilities.warn(reaction.message,member);
}
if (reaction.emoji.name == '♻️' && reaction.count >= 3 && reaction.message.channel == utilities.salonMeme && !reaction.message.author.bot && reaction.message.author.id != "352459053928022017") {
if (reaction.emoji.name === '♻️' && reaction.count >= 3 && reaction.message.channel == utilities.salonMeme && !reaction.message.author.bot && reaction.message.author.id != "352459053928022017") {
reaction.message.channel.send("le repost hammer est tombé sur " + reaction.message.author.username + " *bonk*")
await utilities.warn(reaction.message,null);
await reaction.message.delete();
Expand All @@ -103,11 +103,9 @@ client.on(Events.MessageReactionAdd, async (reaction, user) => {

// listener pour sondage
client.on('messageCreate', message => {
if (message.channel.id == CHANNEL_SONDAGE) {
if (message.channel.id == salonSondage) {
let command = client.commands.get("sondage");
command.newSondage(message);
} else {
return;
}
});

Expand Down
Loading

0 comments on commit bf0fcd0

Please sign in to comment.