remake yabai command to be more fun!

This commit is contained in:
2025-06-24 02:09:12 +02:00
parent 2a430befbf
commit 39448cbad4
3 changed files with 21 additions and 12 deletions

View File

@@ -15,7 +15,8 @@ eventSub.onChannelChatMessage(streamerId, streamerId, async msg => {
if (msg.messageText.startsWith(commandPrefix)) {
const commandSelection = msg.messageText.slice(commandPrefix.length).split(' ')[0]!;
const selected = commands.get(commandSelection.toLowerCase());
if (!selected) { await sendMessage(`${commandSelection} command does not exist`, { replyParentMessageId: msg.messageId }); return; };
await selected.execute(msg, user!);
if (!selected) { await sendMessage(`${commandSelection} command does not exist`, msg.messageId); return; };
try { await selected.execute(msg, user!); }
catch (err) { console.error(err); };
};
});