Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const discordClient = new Discord.Client({
Discord.GatewayIntentBits.GuildPresences,
Discord.GatewayIntentBits.GuildMessages,
Discord.GatewayIntentBits.GuildMessageReactions,
Discord.GatewayIntentBits.GuildMessageTyping,
//Discord.GatewayIntentBits.GuildMessageTyping,
Discord.GatewayIntentBits.DirectMessages,
Discord.GatewayIntentBits.DirectMessageReactions,
//Discord.GatewayIntentBits.DirectMessageTyping,
Expand Down Expand Up @@ -242,9 +242,10 @@ discordClient.on("roleDelete", async (eventRole) =>{
});

//A rank is edited
discordClient.on("roleUpdate", async (eventOldRole, eventNewRole) =>{
//Disabled : sometimes, when a role is created, this event will be triggered multiple times
/*discordClient.on("roleUpdate", async (eventOldRole, eventNewRole) =>{
event_functions.roleUpdate(eventOldRole, eventNewRole, logger, database_pool);
});
});*/

//An user is banned from the guild
discordClient.on("guildBanAdd", async (eventBan) =>{
Expand Down Expand Up @@ -279,9 +280,10 @@ discordClient.on("voiceStateUpdate", async (oldState, newState) =>{
});*/

//A guildMember is typing
discordClient.on("typingStart", async (typingState) =>{
//Disabled : This event is always triggered multiple times when a big message is written
/*discordClient.on("typingStart", async (typingState) =>{
event_functions.typingStart(typingState, logger, database_pool);
});
});*/

/*############################################*/
/* Starting the bot */
Expand Down
2 changes: 1 addition & 1 deletion modules/event_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module.exports = {
return;
}

if(eventNewMessage.channel.type == Discord.ChannelType.DM){return;}//Do nothing if done in PM channel
if(eventNewMessage.channel.type == Discord.ChannelType.DM || eventNewMessage.author.bot || eventOldMessage.content === eventNewMessage.content ){return;}//Do nothing if done in PM channel or author is bot or content wasn't edited
const CURRENT_GUILD = eventNewMessage.guild;//We save here the guild we're working on

logger.debug("A message was edited in guild "+CURRENT_GUILD.id+", creating a SQL request...");
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.