diff options
| -rw-r--r-- | autofeur_db/src/trie.rs | 2 | ||||
| -rw-r--r-- | discordjs/src/index.mjs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/autofeur_db/src/trie.rs b/autofeur_db/src/trie.rs index b202a97..bbc2a93 100644 --- a/autofeur_db/src/trie.rs +++ b/autofeur_db/src/trie.rs @@ -112,7 +112,7 @@ impl<'a> Trie<'a> { current_node .child_nodes .iter() - .map(|(_, node)| node.child_count), + .map(|(_, node)| node.child_count / (length + 1)), ) .expect("distribution creation should be valid"); diff --git a/discordjs/src/index.mjs b/discordjs/src/index.mjs index 94499e5..c28c65d 100644 --- a/discordjs/src/index.mjs +++ b/discordjs/src/index.mjs @@ -1,5 +1,5 @@ // Require the necessary discord.js classes -import { Client, GatewayIntentBits } from 'discord.js'; +import { Client, GatewayIntentBits, Message } from 'discord.js'; import { request } from "undici"; // Create a new client instance @@ -42,6 +42,7 @@ client.on("messageCreate", async (message) => { try { // Get the completed word found by the db. + let response = await completeWord(cutWord(message.cleanContent)); // Ignore if there is no completion |
