diff options
| -rw-r--r-- | discordjs/src/index.mjs | 29 | 
1 files changed, 15 insertions, 14 deletions
diff --git a/discordjs/src/index.mjs b/discordjs/src/index.mjs index f0a4bae..589d75a 100644 --- a/discordjs/src/index.mjs +++ b/discordjs/src/index.mjs @@ -7,13 +7,14 @@ const SYMBOL_FOR_CREATE = Symbol.for("CREATE");  const SYMBOL_FOR_UPDATE = Symbol.for("UPDATE");  // Create a new client instance -const client = new Client({ intents: -  [ -    GatewayIntentBits.Guilds, -    GatewayIntentBits.MessageContent, -    GatewayIntentBits.GuildMessages, -    GatewayIntentBits.DirectMessages -  ] +const client = new Client({ +  intents: +    [ +      GatewayIntentBits.Guilds, +      GatewayIntentBits.MessageContent, +      GatewayIntentBits.GuildMessages, +      GatewayIntentBits.DirectMessages +    ]  });  // `autofeur_db` service @@ -40,13 +41,13 @@ export const completeWord = (grapheme) => {   */  const sanitizeWord = (sentence) => {    let lastWord = sentence -    .trim() -    .split(" ") -    .slice(-1)[0]      .replaceAll(/(?:https?|ftp):\/\/[\n\S]+/g, "")      .replaceAll(/\:([a-z]|[A-Z])+\:/g, "")      .replaceAll(/(\?|\!|\.|\,|\;)/g, "") -    .replaceAll(/([^A-z])/g, ""); +    .replaceAll(/([^A-z])/g, "") +    .trim() +    .split(" ") +    .slice(-1)[0];    return lastWord;  };  const anyTrivialCharRegex = /([a-z]|[A-Z])+/g; @@ -74,11 +75,11 @@ const messageAction = async (message, ctx) => {      .messages      .fetch({        limit: 2, -      cache : false +      cache: false      }))      .last()      .createdTimestamp; -   +    let shouldReplyByTimestamp = currentTimestamp - lastMessageTimestamp >= 3600000;    let shouldReplyByCounter =      messageReplyCounter >= Math.floor(Math.random() * 75) + 35; @@ -107,7 +108,7 @@ const messageAction = async (message, ctx) => {        messageReplyCounter = oldCounter;      }    } -   +    if (message.content.includes("@everyone") && !ignoredChannels.includes(message.channelId)) {      message.reply("https://cdn.mpgn.dev/pascontent-gabe.gif");    }  | 
