Update imports and group info extraction from context.

This commit is contained in:
2025-12-16 15:24:16 -05:00
parent 8d8b7f4c3a
commit 789803da59
6 changed files with 17 additions and 17 deletions

View File

@@ -3,7 +3,7 @@ import type { Context } from "#root/bot/context.js";
import { logHandle } from "#root/bot/helpers/logging.js";
import { metaRegex } from "#root/lib/metaLinkCheck.js";
import { urql } from "#root/main.js";
import increment from "#root/lib/graphql/mutations/incrimentMutation.js";
import increment from "#root/lib/graphql/mutations/incrementMutation.js";
import addGroup from "#root/lib/graphql/mutations/addGroupMutation.js";
import incrementGroup from "#root/lib/graphql/mutations/incrementGroupMutation.js";
@@ -32,16 +32,16 @@ feature.hears(
.mutation(increment, { link: true, mutationKey })
.toPromise()
.then(async () => {
if (ctx.msg) {
if (ctx.msg && ctx.chat) {
// Replies to the user informing them of the action.
await ctx.reply(
`@${username} Facebook and meta links along with with links to meta\\-owned services are not allowed here\\. Please consider sharing the media directly or from other social media sources or websites\\. No administration action was taken against you other than the message being deleted\\.`,
{ parse_mode: "MarkdownV2" }
);
const groupName = ctx.chat?.title;
const groupID = ctx.chat?.id;
const groupUsername = ctx.chat?.username;
const groupName = ctx.chat?.title || "";
const groupID = ctx.chat?.id.toString() || "";
const groupUsername = ctx.chat?.username || "";
return await urql
.mutation(addGroup, {