diff --git a/src/bot/features/statsSiteCommand.ts b/src/bot/features/botStatsSiteCommand.ts similarity index 100% rename from src/bot/features/statsSiteCommand.ts rename to src/bot/features/botStatsSiteCommand.ts diff --git a/src/bot/features/registerBotCommand.ts b/src/bot/features/registerGroupCommand.ts similarity index 96% rename from src/bot/features/registerBotCommand.ts rename to src/bot/features/registerGroupCommand.ts index 3fd3408..9bd9ee8 100644 --- a/src/bot/features/registerBotCommand.ts +++ b/src/bot/features/registerGroupCommand.ts @@ -9,8 +9,6 @@ const composer = new Composer(); const feature = composer.chatType(["group", "supergroup"]); -const mutationKey = process.env.GRAPHQL_MUTATION_KEY || ""; - /** * What triggers this feature and adds to the log when it has been triggered. * The trigger is the command "/registerGroup" @@ -19,6 +17,8 @@ feature.hears( /^\/registerGroup/, logHandle("register-group-command"), async (ctx: Context) => { + const mutationKey = process.env.GRAPHQL_MUTATION_KEY || ""; + await urql.mutation(increment, { trigger: true, mutationKey }); // Checks if the context includes a message property. diff --git a/src/bot/index.ts b/src/bot/index.ts index 15a76ac..4aeabee 100644 --- a/src/bot/index.ts +++ b/src/bot/index.ts @@ -18,9 +18,9 @@ import { metaBlacklist } from "./features/metaBlacklist.js"; import { botInfoCommand } from "./features/botInfoCommand.js"; import { helpCommand } from "./features/helpCommand.js"; import { embedCheck } from "./features/embedCheck.js"; -import { registerGroup } from "./features/registerBotCommand.js"; +import { registerGroup } from "./features/registerGroupCommand.js"; import { getGroupStats } from "./features/getGroupStatsCommand.js"; -import { statsSiteCommand } from "./features/statsSiteCommand.js"; +import { statsSiteCommand } from "./features/botStatsSiteCommand.js"; interface Dependencies { config: Config;