From 673172ecd3802fdd7fe2cd7101f08adc7a0dd367 Mon Sep 17 00:00:00 2001 From: DIVISIONSolar Date: Thu, 7 Sep 2023 11:53:50 -0400 Subject: [PATCH] add map command, finish the rest later --- src/commands/chat/information/map-command.ts | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/commands/chat/information/map-command.ts diff --git a/src/commands/chat/information/map-command.ts b/src/commands/chat/information/map-command.ts new file mode 100644 index 0000000..98e1f12 --- /dev/null +++ b/src/commands/chat/information/map-command.ts @@ -0,0 +1,36 @@ +import { ChatInputCommandInteraction, PermissionsString } from 'discord.js'; +import { RateLimiter } from 'discord.js-rate-limiter'; + +import { Language } from '../../../models/enum-helpers/index.js'; +import { EventData } from '../../../models/internal-models.js'; +import { Lang } from '../../../services/index.js'; +import { InteractionUtils } from '../../../utils/index.js'; +import { Command, CommandDeferType } from '../../index.js'; + +export class MapCommand implements Command { + public names = [Lang.getRef('chatCommands.map', Language.Default)]; + public cooldown = new RateLimiter(1, 5000); + public deferType = CommandDeferType.HIDDEN; + public requireClientPerms: PermissionsString[] = []; + + public async execute(intr: ChatInputCommandInteraction, data: EventData): Promise { + let args = { + Server: intr.options.getString(Lang.getRef('arguments.server', Language.Default)), + }; + + // Check if the user entered "Survival" + if (args.Server.toLowerCase() === "survival") { + await intr.reply('Here is the link for Survival: https://map.pxlvrs.net/survival'); + } + + // Check if the user entered "LifeSteal" + else if (args.Server.toLowerCase() === "lifesteal") { + await intr.reply('Here is the link for LifeSteal: https://map.pxlvrs.net/lifesteal'); + } + + // If the input is not recognized, provide valid inputs + else { + await intr.reply('Invalid input. Valid options are: Survival, LifeSteal'); + } + } +} \ No newline at end of file