INNER CODE UNIT · TypeScript
atTarget
grammyjs/grammY · src/context.ts:223
const atTarget = cmd.substring(index + 1).toLowerCase();
const username = ctx.me.username.toLowerCase();
if (atTarget !== username) return false;
const atCommand = cmd.substring(0, index);
if (noAtCommands.has(atCommand)) {
ctx.match = txt.substring(cmd.length + 1).trimStart();
return true;
}
return false;
});
};
},
reaction(reaction) {
const hasMessageReaction = checker.filterQuery("message_reaction");
const normalized: ReactionType[] = typeof reaction === "string"
? [{ type: "emoji", emoji: reaction }]
: (Array.isArray(reaction) ? reaction : [reaction]).map((emoji) =>
typeof emoji === "string" ? { type: "emoji", emoji } : emoji