mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
disallow aniv bots from giving items
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
import { getUserRecord } from "db/dbUser";
|
import { getUserRecord } from "db/dbUser";
|
||||||
import items, { changeItemCount } from "items";
|
import items, { changeItemCount } from "items";
|
||||||
import { Command, sendMessage } from "lib/commandUtils";
|
import { Command, sendMessage } from "lib/commandUtils";
|
||||||
|
import { ANIVNAMES } from "lib/handleAnivMessage";
|
||||||
import logger from "lib/logger";
|
import logger from "lib/logger";
|
||||||
import parseCommandArgs from "lib/parseCommandArgs";
|
import parseCommandArgs from "lib/parseCommandArgs";
|
||||||
|
import { timeout } from "lib/timeout";
|
||||||
import User from "user";
|
import User from "user";
|
||||||
|
|
||||||
export default new Command({
|
export default new Command({
|
||||||
@@ -10,6 +12,11 @@ export default new Command({
|
|||||||
aliases: ["give"],
|
aliases: ["give"],
|
||||||
usertype: "chatter",
|
usertype: "chatter",
|
||||||
execution: async (msg, user) => {
|
execution: async (msg, user) => {
|
||||||
|
if (Array.from<string>(ANIVNAMES).includes(msg.chatterName)) {
|
||||||
|
await sendMessage("CLANKERS CAN'T GIVE ITEMS UltraMad UltraMad UltraMad");
|
||||||
|
await timeout(user, "STUPID CLANKER", 30);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const args = parseCommandArgs(msg.messageText);
|
const args = parseCommandArgs(msg.messageText);
|
||||||
if (!args[0]) {
|
if (!args[0]) {
|
||||||
await sendMessage("Please specify a user", msg.messageId);
|
await sendMessage("Please specify a user", msg.messageId);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { timeout } from "lib/timeout";
|
|||||||
import type User from "user";
|
import type User from "user";
|
||||||
import { playMSTTS } from "web/alerts/serverFunctions";
|
import { playMSTTS } from "web/alerts/serverFunctions";
|
||||||
|
|
||||||
const ANIVNAMES: anivBots[] = ["a_n_e_e_v", "a_n_i_v"];
|
export const ANIVNAMES: anivBots[] = ["a_n_e_e_v", "a_n_i_v"];
|
||||||
|
|
||||||
type anivMessageStore = {
|
type anivMessageStore = {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user