jank fixes

This commit is contained in:
2025-09-11 14:44:26 +02:00
parent 7af09370da
commit 3e373056c9
8 changed files with 38 additions and 11 deletions

View File

@@ -0,0 +1,20 @@
import { Command, sendMessage } from "commands";
import parseCommandArgs from "lib/parseCommandArgs";
import { timeout } from "lib/timeout";
import User from "user";
import { playAlert } from "web/alerts/serverFunctions";
export default new Command('banclanker', ['banclanker', 'banbot'], 'moderator', async msg => {
const args = parseCommandArgs(msg.messageText);
if (!args[0]) { await sendMessage(`Specify a clanker to ban`, msg.messageId); return; };
const target = await User.initUsername(args[0]);
if (!target) { await sendMessage(`Clanker ${args[0]} doesn't exist`, msg.messageId); return; };
await Promise.all([
timeout(target, `get fucked`),
playAlert({
name: 'userExecution',
user: msg.chatterDisplayName,
target: target.displayName
})
]);
});

View File

@@ -17,7 +17,7 @@ export default new Command('getloot', ['getloot', 'dig', 'loot'], 'chatter', asy
if (await user.greedy()) {
await Promise.all([
sendMessage(`${user.displayName} STOP BEING GREEDY!!! UltraMad UltraMad UltraMad`),
timeout(user, 'STOP BEING GREEDY!!!', 60)
timeout(user, `Wait ${buildTimeString(now - COOLDOWN, lastlootbox)}`, 60)
]);
return;
} else {

View File

@@ -1,7 +1,7 @@
import { EventSubChannelChatMessageEvent } from "@twurple/eventsub-base";
import User from "user";
export type userType = 'chatter' | 'admin' | 'streamer';
export type userType = 'chatter' | 'admin' | 'streamer' | 'moderator';
/** The Command class represents a command */
export class Command {
@@ -46,5 +46,5 @@ import { chatterApi, chatterId, streamerId } from "main";
/** Helper function to send a message to the stream */
export const sendMessage = async (message: string, replyParentMessageId?: string) => {
await chatterApi.chat.sendChatMessageAsApp(chatterId, streamerId, message, { replyParentMessageId })
return await chatterApi.chat.sendChatMessageAsApp(chatterId, streamerId, message, { replyParentMessageId })
};