1
1
mirror of https://github.com/Burn-E99/GroupUp.git synced 2026-06-04 08:53:49 -04:00

Add documentation around fillerChar so that I don't spend 20 minutes wondering why I am adding $$$$$$$$ to things

This commit is contained in:
Ean Milligan (Bastion)
2023-04-26 08:09:58 -04:00
parent 71c0900093
commit 2a6fbdbf6c
3 changed files with 9 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
import { Bot, BotWithCache, Interaction, log, LT } from '../../deps.ts';
import { buttons } from '../buttons/_index.ts';
import { commands } from '../commands/_index.ts';
import { idSeparator } from '../buttons/eventUtils.ts';
import { idSeparator, fillerChar } from '../buttons/eventUtils.ts';
const commandNames: Array<string> = commands.map((command) => command.details.name);
const buttonNames: Array<string> = buttons.map((button) => button.customId);
@@ -15,7 +15,7 @@ export const interactionCreate = (rawBot: Bot, interaction: Interaction) => {
return;
}
const tempCustomId = interaction.data.customId ? interaction.data.customId.replace(/\$/g, '') : '';
const tempCustomId = interaction.data.customId ? interaction.data.customId.replaceAll(fillerChar, '') : '';
const customId = tempCustomId.split(idSeparator)[0] || '';
if (customId && buttonNames.includes(customId)) {
const btnIdx = buttonNames.indexOf(customId);