Skip to content

Commit

Permalink
forgot about the start
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 e9dd016 commit 4693463
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(triggers.join("\\b|").slice(0, -1)).test(
const match = new RegExp("\\b" + triggers.join("\\b|\\b").slice(0, -3)).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(TRIGGER_WORDS.join("\\b|").slice(0, -1)).test(
const isTriggerWord = new RegExp("\\b" + TRIGGER_WORDS.join("\\b|\\b").slice(0, -3)).test(
msg.content.toLowerCase()
);
const isMaybeTriggerWord =
rng <= MAYBE_TRIGGER_FREQ &&
new RegExp(MAYBE_TRIGGER_WORDS.join("\\b|").slice(0, -1)).test(
new RegExp("\\b" + MAYBE_TRIGGER_WORDS.join("\\b|\\b").slice(0, -3)).test(
msg.content.toLowerCase()
);
const isChatChannel = bot.config.channels.chat === msg.channelId;
Expand Down

0 comments on commit 4693463

Please sign in to comment.