]> git.puffer.fish Git - matthieu/gru.git/commitdiff
change probability
authorMatthieu Pignolet <matthieu@matthieu-dev.xyz>
Fri, 7 Jun 2024 16:12:18 +0000 (20:12 +0400)
committerMatthieu Pignolet <matthieu@matthieu-dev.xyz>
Fri, 7 Jun 2024 16:12:18 +0000 (20:12 +0400)
discordjs/src/index.mjs

index aa2c1bd826f424d38caeedbf0a397b32e416b484..b4d558d85e0119860470e341f42009cadc587d60 100644 (file)
@@ -1,5 +1,5 @@
 // Require the necessary discord.js classes
-import { Client, GatewayIntentBits, Message, MessageType } from 'discord.js';
+import { Client, GatewayIntentBits } from 'discord.js';
 import { request } from "undici";
 
 // Create a new client instance
@@ -52,7 +52,7 @@ client.on("messageCreate", async (message) => {
     let response = await completeWord(cutWord(message.cleanContent));
 
     // Ignore if there is no completion
-    if ((response || response === "") && (Math.random() > 0.95 || message.channelId == '1248226018406301696' || message.guild == null)) {
+    if ((response || response === "") && (Math.random() > 0.995 || message.channelId == '1248226018406301696' || message.guild == null)) {
       message.reply(response);
     }
   } catch (e) {
@@ -69,7 +69,7 @@ client.on("messageUpdate", async (message) => {
     let response = await completeWord(cutWord(message.cleanContent));
 
     // Ignore if there is no completion
-    if ((response || response === "") && (Math.random() > 0.95 || message.channelId == '1248226018406301696' || message.guild == null)) {
+    if ((response || response === "") && (Math.random() > 0.995 || message.channelId == '1248226018406301696' || message.guild == null)) {
       message.reply(response);
     }
   } catch (e) {