Skip to content

Commit

Permalink
this is not how
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Dec 24, 2023
1 parent 4693463 commit ea84234
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/services/discord/modules/discord-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default (bot: DiscordBot): void => {
usr.roles.add(DiscordConfig.roles.event);
});
for (const { icon, triggers } of events) {
const match = new RegExp("\\b" + triggers.join("\\b|\\b").slice(0, -3)).test(
const match = new RegExp("\\b" + triggers.join("\\b|\\b") + "\\b").test(
event.name.toLowerCase()
);
if (match) {
Expand Down
4 changes: 2 additions & 2 deletions app/services/discord/modules/shitposting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,12 @@ export default async (bot: DiscordBot) => {
const rng = Math.random();

// triggers
const isTriggerWord = new RegExp("\\b" + TRIGGER_WORDS.join("\\b|\\b").slice(0, -3)).test(
const isTriggerWord = new RegExp("\\b" + TRIGGER_WORDS.join("\\b|\\b") + "\\b").test(
msg.content.toLowerCase()
);
const isMaybeTriggerWord =
rng <= MAYBE_TRIGGER_FREQ &&
new RegExp("\\b" + MAYBE_TRIGGER_WORDS.join("\\b|\\b").slice(0, -3)).test(
new RegExp("\\b" + MAYBE_TRIGGER_WORDS.join("\\b|\\b") + "\\b").test(
msg.content.toLowerCase()
);
const isChatChannel = bot.config.channels.chat === msg.channelId;
Expand Down

0 comments on commit ea84234

Please sign in to comment.