Moved env variables into function.

This commit is contained in:
2026-01-26 19:34:25 -05:00
parent 1361fab0ad
commit d816568522
6 changed files with 15 additions and 15 deletions

View File

@@ -8,8 +8,6 @@ const composer = new Composer<Context>();
const feature = composer.chatType(["private", "group", "supergroup"]); const feature = composer.chatType(["private", "group", "supergroup"]);
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
/** /**
* What triggers this feature and adds to the log when it has been triggered. * What triggers this feature and adds to the log when it has been triggered.
* The trigger is the command "/botInfo" * The trigger is the command "/botInfo"
@@ -18,6 +16,8 @@ feature.hears(
/^\/botInfo/, /^\/botInfo/,
logHandle("bot-info-command"), logHandle("bot-info-command"),
async (ctx: Context) => { async (ctx: Context) => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
await urql.mutation(increment, { trigger: true, mutationKey }); await urql.mutation(increment, { trigger: true, mutationKey });
// Checks if the context includes a message property. // Checks if the context includes a message property.
@@ -45,21 +45,21 @@ feature.hears(
} }
); );
await ctx.reply( await ctx.reply(
`[Lucid](https://werewolfkid.monster) made this bot as a protest against the enshittification of Twitter and Nazi\\-fication of it\\ ever since Elon Must did a Nazi salute at a Trump Rally celebrating Trump\\'s second inauguration\\.`, `[Lucid](https://werewolfkid.monster) made this bot as a protest against the enshittification and Nazi\\-fication of Twitter\\ ever since Elon Musk took it over. The final straw aws when he did a Nazi salute at a Trump Rally celebrating Trump\\'s second inauguration\\.`,
{ {
parse_mode: "MarkdownV2", parse_mode: "MarkdownV2",
reply_parameters: { message_id: ctx.msg.message_id } reply_parameters: { message_id: ctx.msg.message_id }
} }
); );
await ctx.reply( await ctx.reply(
`Recently there have been reports of extremist right\\-wing individuals doxxing and harassing anyone left of center\\. The victims have come out to state that they\\'ve had several accounts hacked into\\, including onces with unique passwords\\. It is clear that these assholes are using some kind of script kiddie malware to capture\\/steal credentials and possibly even stored passwords\\.`, `There have been reports of extremist right\\-wing individuals doxxing and harassing anyone left of center\\. The victims have come out to state that they\\'ve had several accounts hacked into\\, including onces with unique passwords\\. It is clear that these assholes are using some kind of script kiddie malware to capture\\/steal credentials and possibly even stored passwords\\.`,
{ {
parse_mode: "MarkdownV2", parse_mode: "MarkdownV2",
reply_parameters: { message_id: ctx.msg.message_id } reply_parameters: { message_id: ctx.msg.message_id }
} }
); );
return await ctx.reply( return await ctx.reply(
`Lucid decided it was time to make a statement\\. Twitter\\/X is not safe anymore\\. The fandom doesn\\'t need it\\. It should be boycotted and not allowed anymore\\. Thus decided to try making this bot public\\-use to test it's viability\\. Feel free to add this bot into your own group\\. All it needs is an admin role with the permission to delete messages\\.`, `Lucid decided it was time to make a statement\\. Twitter\\/X is not safe anymore\\. The fandom doesn\\'t need it\\. It should be boycotted and not allowed anymore\\. Thus he decided to try making this bot public\\-use to test it's viability\\. Feel free to add this bot into your own group\\. All it needs is an admin role with the permission to delete messages\\.`,
{ {
parse_mode: "MarkdownV2", parse_mode: "MarkdownV2",
reply_parameters: { message_id: ctx.msg.message_id } reply_parameters: { message_id: ctx.msg.message_id }

View File

@@ -12,13 +12,13 @@ const composer = new Composer<Context>();
const feature = composer.chatType(["group", "supergroup"]); 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. * What triggers this feature and adds to the log when it has been triggered.
* The trigger is anytime an embedded url is detected. * The trigger is anytime an embedded url is detected.
*/ */
feature.on("message::url", logHandle("embed-check"), async (ctx: Context) => { feature.on("message::url", logHandle("embed-check"), async (ctx: Context) => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
await urql.mutation(increment, { trigger: true, mutationKey }); await urql.mutation(increment, { trigger: true, mutationKey });
if (ctx.chat && ctx.msg) { if (ctx.chat && ctx.msg) {

View File

@@ -9,8 +9,6 @@ const composer = new Composer<Context>();
const feature = composer.chatType(["group", "supergroup"]); 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. * What triggers this feature and adds to the log when it has been triggered.
* The trigger is the command "/groupStats" * The trigger is the command "/groupStats"
@@ -19,6 +17,8 @@ feature.hears(
/^\/groupStats/, /^\/groupStats/,
logHandle("groups-stats-command"), logHandle("groups-stats-command"),
async (ctx: Context) => { async (ctx: Context) => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
await urql.mutation(increment, { trigger: true, mutationKey }); await urql.mutation(increment, { trigger: true, mutationKey });
// Checks if the context includes a message property. // Checks if the context includes a message property.

View File

@@ -11,8 +11,6 @@ const composer = new Composer<Context>();
const feature = composer.chatType(["group", "supergroup"]); 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. * What triggers this feature and adds to the log when it has been triggered.
* The trigger uses the global Twitter regex to detect Twitter and X links within messages. * The trigger uses the global Twitter regex to detect Twitter and X links within messages.
@@ -21,6 +19,8 @@ feature.hears(
metaRegex, metaRegex,
logHandle("blacklist-detection-meta"), logHandle("blacklist-detection-meta"),
async (ctx: Context) => { async (ctx: Context) => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
await urql.mutation(increment, { trigger: true, mutationKey }); await urql.mutation(increment, { trigger: true, mutationKey });
if (ctx.chat && ctx.msg) { if (ctx.chat && ctx.msg) {

View File

@@ -11,8 +11,6 @@ const composer = new Composer<Context>();
const feature = composer.chatType(["group", "supergroup"]); 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. * What triggers this feature and adds to the log when it has been triggered.
* The trigger uses the global Twitter regex to detect Twitter and X links within messages. * The trigger uses the global Twitter regex to detect Twitter and X links within messages.
@@ -21,6 +19,8 @@ feature.hears(
twitterRegex, twitterRegex,
logHandle("blacklist-detection-twitter"), logHandle("blacklist-detection-twitter"),
async (ctx: Context) => { async (ctx: Context) => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
await urql.mutation(increment, { trigger: true, mutationKey }); await urql.mutation(increment, { trigger: true, mutationKey });
if (ctx.chat && ctx.msg) { if (ctx.chat && ctx.msg) {

View File

@@ -8,13 +8,13 @@ const composer = new Composer<Context>();
const feature = composer.chatType("private"); const feature = composer.chatType("private");
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
/** /**
* What triggers this feature and adds to the log when it has been triggered. * What triggers this feature and adds to the log when it has been triggered.
* The trigger is the command "/start" or "start" * The trigger is the command "/start" or "start"
*/ */
feature.command("start", logHandle("command-start"), async ctx => { feature.command("start", logHandle("command-start"), async ctx => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
await urql.mutation(increment, { trigger: true, mutationKey }); await urql.mutation(increment, { trigger: true, mutationKey });
await urql await urql