add vanish command
This commit is contained in:
28
src/commands/impl/vanish.ts
Normal file
28
src/commands/impl/vanish.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { purgeByIds } from "../../util/api-functions.ts";
|
||||
import { logSuccess } from "../../util/logger.ts";
|
||||
import { BaseCommand } from "../base-command.ts";
|
||||
import type { ICommandRequirements } from "../interface.ts";
|
||||
|
||||
export class VanishCommand extends BaseCommand {
|
||||
name = "v";
|
||||
cooldown = 0;
|
||||
enabled = true;
|
||||
|
||||
requirements: ICommandRequirements = {
|
||||
developer: false,
|
||||
mod: false,
|
||||
};
|
||||
|
||||
triggered = async (
|
||||
channel: string,
|
||||
user: string,
|
||||
_text: string,
|
||||
msg: ChatMessage,
|
||||
) => {
|
||||
logSuccess(`${channel} ${user} vanish command triggered`);
|
||||
if (msg.channelId) {
|
||||
purgeByIds(msg.channelId, msg.userInfo.userId);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user