mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 11:06:59 +01:00
Compare commits
2 Commits
ebdf6264d4
...
04487d3aae
| Author | SHA1 | Date | |
|---|---|---|---|
|
04487d3aae
|
|||
|
56aa677fe0
|
@@ -1,5 +1,5 @@
|
||||
import { EventSubChannelChatMessageEvent } from "@twurple/eventsub-base"
|
||||
import { streamerId, eventSub, commandPrefix, streamerUsers } from "main";
|
||||
import { streamerId, eventSub, commandPrefix, streamerUsers, chatterId } from "main";
|
||||
import User from "user";
|
||||
import commands, { Command, sendMessage, specialAliasCommands } from "commands";
|
||||
import { redis } from "bun";
|
||||
@@ -27,7 +27,7 @@ async function parseChatMessage(msg: EventSubChannelChatMessageEvent) {
|
||||
// and both are usable to target the same user (id is the same)
|
||||
// The only problem would be if a user changed their name and someone else took their name right after
|
||||
|
||||
if (!await isInvuln(user?.id!)) user?.setVulnerable(); // Make the user vulnerable to explosions if not marked as invuln
|
||||
if (msg.chatterId === chatterId) return;
|
||||
|
||||
if (!await redis.exists(`user:${user?.id}:haschatted`) && !msg.sourceMessageId) {
|
||||
const message = await sendMessage(`Welcome ${user?.displayName}. Please note: This chat has PvP, if you get timed out that's part of the qwerinope experience. You have 10 minutes of invincibility. A full list of commands and items can be found here: https://github.com/qwerinope/qweribot/#qweribot`);
|
||||
@@ -37,6 +37,8 @@ async function parseChatMessage(msg: EventSubChannelChatMessageEvent) {
|
||||
if (!await isInvuln(msg.chatterId)) await setTemporaryInvuln(user?.id!); // This would set the invuln expiration lmao
|
||||
};
|
||||
|
||||
if (!await isInvuln(user?.id!)) user?.setVulnerable(); // Make the user vulnerable to explosions if not marked as invuln
|
||||
|
||||
if (!msg.isCheer && !msg.isRedemption) await handleChatMessage(msg, user!)
|
||||
else if (msg.isCheer && !msg.isRedemption) await handleCheer(msg, msg.bits, user!);
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function parseCommandArgs(input: string, specialAlias?: string) {
|
||||
nice = input.toLowerCase().slice(commandPrefix.length).trim();
|
||||
sliceLength = nice.startsWith('use') ? 2 : 1;
|
||||
}
|
||||
return nice.split(' ').slice(sliceLength);
|
||||
return nice.split(' ').slice(sliceLength).map(a => a.replaceAll(/!/gi, ''));
|
||||
};
|
||||
|
||||
export function parseCheerArgs(input: string) {
|
||||
|
||||
Reference in New Issue
Block a user