From 101daf125c3354b596514960a622729bc876c205 Mon Sep 17 00:00:00 2001 From: Essem Date: Tue, 17 Feb 2026 15:08:56 -0600 Subject: [PATCH] refactor: Migrate command flags to new syntax --- commands/fun/8ball.js | 3 +-- commands/fun/dice.js | 3 +-- commands/general/avatar.js | 6 +++--- commands/general/banner.js | 6 +++--- commands/general/base64/decode.js | 3 +-- commands/general/base64/encode.js | 3 +-- commands/general/broadcast.js | 3 +-- commands/general/channel.js | 10 +++++----- commands/general/command.js | 9 ++++----- commands/general/count.js | 3 +-- commands/general/emote.js | 3 +-- commands/general/eval.js | 5 ++--- commands/general/exec.js | 3 +-- commands/general/help.js | 9 +++------ commands/general/image.js | 3 +-- commands/general/lengthen.js | 3 +-- commands/general/prefix.js | 3 +-- commands/general/raw.js | 5 ++--- commands/general/reload.js | 5 ++--- commands/general/snowflake.js | 3 +-- commands/general/youtube.js | 3 +-- commands/image-editing/caption.js | 5 ++--- commands/image-editing/caption2.js | 5 ++--- commands/image-editing/fade.js | 3 +-- commands/image-editing/freeze.js | 3 +-- commands/image-editing/globe.js | 3 +-- commands/image-editing/hue.js | 5 ++--- commands/image-editing/jpeg.js | 3 +-- commands/image-editing/meme.js | 5 ++--- commands/image-editing/motivate.js | 3 +-- commands/image-editing/slide.js | 5 ++--- commands/image-editing/slow.js | 3 +-- commands/image-editing/snapchat.js | 3 +-- commands/image-editing/speechbubble.js | 9 ++++----- commands/image-editing/speed.js | 3 +-- commands/image-editing/uncanny.js | 5 ++--- commands/image-editing/uncaption.js | 3 +-- commands/image-editing/wide.js | 3 +-- commands/music/music/host.js | 4 ++-- commands/music/music/play.js | 4 ++-- commands/music/music/remove.js | 3 +-- commands/music/music/seek.js | 3 +-- commands/music/music/volume.js | 3 +-- commands/tags/tags/add.js | 5 ++--- commands/tags/tags/delete.js | 3 +-- commands/tags/tags/edit.js | 5 ++--- commands/tags/tags/get.js | 3 +-- commands/tags/tags/owner.js | 3 +-- commands/tags/tags/role.js | 11 +++++------ 49 files changed, 82 insertions(+), 128 deletions(-) diff --git a/commands/fun/8ball.js b/commands/fun/8ball.js index d902f26b..0b6687e2 100644 --- a/commands/fun/8ball.js +++ b/commands/fun/8ball.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { random } from "#utils/misc.js"; @@ -33,7 +32,7 @@ class EightBallCommand extends Command { static flags = [ { name: "question", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "A question you want to ask the ball", classic: true, }, diff --git a/commands/fun/dice.js b/commands/fun/dice.js index e114096c..b682e295 100644 --- a/commands/fun/dice.js +++ b/commands/fun/dice.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class DiceCommand extends Command { @@ -14,7 +13,7 @@ class DiceCommand extends Command { static flags = [ { name: "max", - type: Constants.ApplicationCommandOptionTypes.INTEGER, + type: "integer", description: "The maximum dice value", minValue: 1, classic: true, diff --git a/commands/general/avatar.js b/commands/general/avatar.js index 462502e7..04a898a4 100644 --- a/commands/general/avatar.js +++ b/commands/general/avatar.js @@ -1,4 +1,4 @@ -import { Constants, Member } from "oceanic.js"; +import { Member } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { getUser, mentionToObject } from "#utils/mentions.js"; const imageSize = 512; @@ -43,13 +43,13 @@ class AvatarCommand extends Command { static flags = [ { name: "member", - type: Constants.ApplicationCommandOptionTypes.USER, + type: "user", description: "The member to get the avatar from", classic: true, }, { name: "server", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", description: "Gets a user's server avatar", classic: true, default: false, diff --git a/commands/general/banner.js b/commands/general/banner.js index 9491fb85..9b6afd2a 100644 --- a/commands/general/banner.js +++ b/commands/general/banner.js @@ -1,4 +1,4 @@ -import { Constants, Member } from "oceanic.js"; +import { Member } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { getUser, mentionToObject } from "#utils/mentions.js"; const imageSize = 4096; @@ -70,13 +70,13 @@ class BannerCommand extends Command { static flags = [ { name: "member", - type: Constants.ApplicationCommandOptionTypes.USER, + type: "user", description: "The member to get the banner from", classic: true, }, { name: "server", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", description: "Gets a user's server banner", classic: true, default: false, diff --git a/commands/general/base64/decode.js b/commands/general/base64/decode.js index dd11b0c8..896016a4 100644 --- a/commands/general/base64/decode.js +++ b/commands/general/base64/decode.js @@ -1,5 +1,4 @@ import { Buffer } from "node:buffer"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class Base64DecodeCommand extends Command { @@ -15,7 +14,7 @@ class Base64DecodeCommand extends Command { static flags = [ { name: "text", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The text to decode", classic: true, required: true, diff --git a/commands/general/base64/encode.js b/commands/general/base64/encode.js index a836e389..faf903f8 100644 --- a/commands/general/base64/encode.js +++ b/commands/general/base64/encode.js @@ -1,5 +1,4 @@ import { Buffer } from "node:buffer"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class Base64EncodeCommand extends Command { @@ -15,7 +14,7 @@ class Base64EncodeCommand extends Command { static flags = [ { name: "text", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The text to encode", classic: true, required: true, diff --git a/commands/general/broadcast.js b/commands/general/broadcast.js index 8ff45ce1..6c1814bf 100644 --- a/commands/general/broadcast.js +++ b/commands/general/broadcast.js @@ -1,5 +1,4 @@ import process from "node:process"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { endBroadcast, startBroadcast } from "#utils/misc.js"; @@ -43,7 +42,7 @@ class BroadcastCommand extends Command { static flags = [ { name: "message", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The message to broadcast", }, ]; diff --git a/commands/general/channel.js b/commands/general/channel.js index 561cf01b..af661393 100644 --- a/commands/general/channel.js +++ b/commands/general/channel.js @@ -1,5 +1,5 @@ import process from "node:process"; -import { Constants, GuildChannel } from "oceanic.js"; +import { GuildChannel } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { safeBigInt } from "#utils/misc.js"; @@ -76,12 +76,12 @@ class ChannelCommand extends Command { static flags = [ { name: "enable", - type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND, + type: "subcommand", description: "Enables classic commands in a channel", options: [ { name: "channel", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The channel to enable", classic: true, }, @@ -89,12 +89,12 @@ class ChannelCommand extends Command { }, { name: "disable", - type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND, + type: "subcommand", description: "Disables classic commands in a channel", options: [ { name: "channel", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The channel to disable", classic: true, }, diff --git a/commands/general/command.js b/commands/general/command.js index 257122bd..0ab87f07 100644 --- a/commands/general/command.js +++ b/commands/general/command.js @@ -1,5 +1,4 @@ import process from "node:process"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import * as collections from "#utils/collections.js"; @@ -50,12 +49,12 @@ class CommandCommand extends Command { static flags = [ { name: "enable", - type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND, + type: "subcommand", description: "Enables a classic command", options: [ { name: "cmd", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The command to enable", classic: true, required: true, @@ -64,12 +63,12 @@ class CommandCommand extends Command { }, { name: "disable", - type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND, + type: "subcommand", description: "Disables a classic command", options: [ { name: "cmd", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The command to disable", classic: true, required: true, diff --git a/commands/general/count.js b/commands/general/count.js index e34649f1..b6aade05 100644 --- a/commands/general/count.js +++ b/commands/general/count.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import paginator from "#pagination"; import * as collections from "#utils/collections.js"; @@ -77,7 +76,7 @@ class CountCommand extends Command { static flags = [ { name: "command", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "A specific command to view counts for", classic: true, }, diff --git a/commands/general/emote.js b/commands/general/emote.js index 440ffd8f..c2d5560b 100644 --- a/commands/general/emote.js +++ b/commands/general/emote.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class EmoteCommand extends Command { @@ -35,7 +34,7 @@ class EmoteCommand extends Command { static flags = [ { name: "emoji", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The emoji you want to get", classic: true, required: true, diff --git a/commands/general/eval.js b/commands/general/eval.js index 028dbad7..de9b74a1 100644 --- a/commands/general/eval.js +++ b/commands/general/eval.js @@ -1,6 +1,5 @@ import { Buffer } from "node:buffer"; import process from "node:process"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { clean } from "#utils/misc.js"; @@ -48,14 +47,14 @@ class EvalCommand extends Command { static flags = [ { name: "code", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The code to execute", classic: true, required: true, }, { name: "broadcast", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", description: "Execute on all bot processes (only use if you know what you're doing!)", }, ]; diff --git a/commands/general/exec.js b/commands/general/exec.js index b70f934e..ed01e65c 100644 --- a/commands/general/exec.js +++ b/commands/general/exec.js @@ -2,7 +2,6 @@ import { Buffer } from "node:buffer"; import { exec as baseExec } from "node:child_process"; import process from "node:process"; import { promisify } from "node:util"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { clean } from "#utils/misc.js"; const exec = promisify(baseExec); @@ -41,7 +40,7 @@ class ExecCommand extends Command { static flags = [ { name: "cmd", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The command to execute", classic: true, required: true, diff --git a/commands/general/help.js b/commands/general/help.js index 72d39987..85bc2ebd 100644 --- a/commands/general/help.js +++ b/commands/general/help.js @@ -1,9 +1,8 @@ import process from "node:process"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import paginator from "#pagination"; import * as collections from "#utils/collections.js"; -import { convFlagType } from "#utils/handler.js"; +import { convFlagType, flagMap } from "#utils/handler.js"; import * as help from "#utils/help.js"; class HelpCommand extends Command { @@ -77,9 +76,7 @@ class HelpCommand extends Command { let type = flag.type; if (typeof type === "string") type = convFlagType(type); if (type === 1) continue; - flagInfo.push( - `\`--${flag.name}${type ? `=[${Constants.ApplicationCommandOptionTypes[type]}]` : ""}\` - ${flag.description}`, - ); + flagInfo.push(`\`--${flag.name}${type ? `=[${flagMap[type]}]` : ""}\` - ${flag.description}`); } if (flagInfo.length !== 0) { embed.embeds[0].fields.push({ @@ -155,7 +152,7 @@ class HelpCommand extends Command { static flags = [ { name: "command", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "A command to view info about", classic: true, }, diff --git a/commands/general/image.js b/commands/general/image.js index cb1f15bb..77e019d0 100644 --- a/commands/general/image.js +++ b/commands/general/image.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import serversConfig from "#config/servers.json" with { type: "json" }; import paginator from "#pagination"; @@ -60,7 +59,7 @@ class ImageSearchCommand extends Command { static flags = [ { name: "query", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The query you want to search for", classic: true, required: true, diff --git a/commands/general/lengthen.js b/commands/general/lengthen.js index 936ab4fd..8f3a8099 100644 --- a/commands/general/lengthen.js +++ b/commands/general/lengthen.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class LengthenCommand extends Command { @@ -38,7 +37,7 @@ class LengthenCommand extends Command { static flags = [ { name: "url", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The URL you want to lengthen", classic: true, required: true, diff --git a/commands/general/prefix.js b/commands/general/prefix.js index 321f0d81..f435f1ce 100644 --- a/commands/general/prefix.js +++ b/commands/general/prefix.js @@ -1,5 +1,4 @@ import process from "node:process"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class PrefixCommand extends Command { @@ -39,7 +38,7 @@ class PrefixCommand extends Command { static flags = [ { name: "prefix", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The server prefix you want to use", classic: true, }, diff --git a/commands/general/raw.js b/commands/general/raw.js index 225c4beb..d85be816 100644 --- a/commands/general/raw.js +++ b/commands/general/raw.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import imageDetect from "#utils/mediadetect.js"; @@ -18,12 +17,12 @@ class RawCommand extends Command { static flags = [ { name: "image", - type: Constants.ApplicationCommandOptionTypes.ATTACHMENT, + type: "attachment", description: "An image/GIF attachment", }, { name: "link", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "An image/GIF URL", }, ]; diff --git a/commands/general/reload.js b/commands/general/reload.js index 00029928..fbb7c975 100644 --- a/commands/general/reload.js +++ b/commands/general/reload.js @@ -1,5 +1,4 @@ import process from "node:process"; -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { paths } from "#utils/collections.js"; import { load } from "#utils/handler.js"; @@ -35,14 +34,14 @@ class ReloadCommand extends Command { static flags = [ { name: "cmd", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The command to reload", classic: true, required: true, }, { name: "skipsend", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", description: "Skips sending new application command data to Discord", classic: true, }, diff --git a/commands/general/snowflake.js b/commands/general/snowflake.js index a5d3568b..552c25c1 100644 --- a/commands/general/snowflake.js +++ b/commands/general/snowflake.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class SnowflakeCommand extends Command { @@ -31,7 +30,7 @@ class SnowflakeCommand extends Command { static flags = [ { name: "id", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "A snowflake ID", classic: true, }, diff --git a/commands/general/youtube.js b/commands/general/youtube.js index db010cc5..cb176781 100644 --- a/commands/general/youtube.js +++ b/commands/general/youtube.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import serversConfig from "#config/servers.json" with { type: "json" }; import paginator from "#pagination"; @@ -39,7 +38,7 @@ class YouTubeCommand extends Command { static flags = [ { name: "query", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The query you want to search for", classic: true, required: true, diff --git a/commands/image-editing/caption.js b/commands/image-editing/caption.js index 761e99fa..9604c6ab 100644 --- a/commands/image-editing/caption.js +++ b/commands/image-editing/caption.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class CaptionCommand extends MediaCommand { @@ -27,11 +26,11 @@ class CaptionCommand extends MediaCommand { { name: "noegg", description: "Disable... something. Not saying what it is though.", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }, { name: "font", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", choices: (() => { const array = []; for (const font of this.allowedFonts) { diff --git a/commands/image-editing/caption2.js b/commands/image-editing/caption2.js index 2f7ba380..aa48e829 100644 --- a/commands/image-editing/caption2.js +++ b/commands/image-editing/caption2.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; const words = [ "me irl", @@ -52,11 +51,11 @@ class CaptionTwoCommand extends MediaCommand { { name: "top", description: "Put the caption on the top of an image instead of the bottom", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }, { name: "font", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", choices: (() => { const array = []; for (const font of this.allowedFonts) { diff --git a/commands/image-editing/fade.js b/commands/image-editing/fade.js index d6b33cf0..a0fa11d9 100644 --- a/commands/image-editing/fade.js +++ b/commands/image-editing/fade.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class FadeCommand extends MediaCommand { @@ -14,7 +13,7 @@ class FadeCommand extends MediaCommand { this.flags.push({ name: "alpha", description: "Fade in from transparency", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }); return this; } diff --git a/commands/image-editing/freeze.js b/commands/image-editing/freeze.js index d953875e..517c580f 100644 --- a/commands/image-editing/freeze.js +++ b/commands/image-editing/freeze.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class FreezeCommand extends MediaCommand { @@ -14,7 +13,7 @@ class FreezeCommand extends MediaCommand { super.init(); this.flags.push({ name: "endframe", - type: Constants.ApplicationCommandOptionTypes.INTEGER, + type: "integer", description: "Set the end frame (default: last frame)", minValue: 0, classic: true, diff --git a/commands/image-editing/globe.js b/commands/image-editing/globe.js index 1db94cae..bb8be4ef 100644 --- a/commands/image-editing/globe.js +++ b/commands/image-editing/globe.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class GlobeCommand extends MediaCommand { @@ -14,7 +13,7 @@ class GlobeCommand extends MediaCommand { this.flags.push({ name: "snow", description: "Turns the globe into a snow globe", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }); return this; } diff --git a/commands/image-editing/hue.js b/commands/image-editing/hue.js index a5270a98..20fa1198 100644 --- a/commands/image-editing/hue.js +++ b/commands/image-editing/hue.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class HueCommand extends MediaCommand { @@ -16,7 +15,7 @@ class HueCommand extends MediaCommand { // so we use unshift instead of push here this.flags.unshift({ name: "shift", - type: Constants.ApplicationCommandOptionTypes.INTEGER, + type: "integer", description: "Set the amount to shift by", minValue: -180, maxValue: 180, @@ -30,7 +29,7 @@ class HueCommand extends MediaCommand { static requiresParam = true; static requiredParam = "shift"; - static requiredParamType = Constants.ApplicationCommandOptionTypes.INTEGER; + static requiredParamType = "integer"; static noParam = "You need to provide the amount you want to hue shift by!"; static noImage = "You need to provide an image/GIF to hue shift!"; diff --git a/commands/image-editing/jpeg.js b/commands/image-editing/jpeg.js index 90216d9f..e5a9d47e 100644 --- a/commands/image-editing/jpeg.js +++ b/commands/image-editing/jpeg.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class JPEGCommand extends MediaCommand { @@ -13,7 +12,7 @@ class JPEGCommand extends MediaCommand { super.init(); this.flags.push({ name: "quality", - type: Constants.ApplicationCommandOptionTypes.INTEGER, + type: "integer", description: "Set the JPEG quality (default: 1)", minValue: 1, maxValue: 100, diff --git a/commands/image-editing/meme.js b/commands/image-editing/meme.js index 04428ca5..bf5bea13 100644 --- a/commands/image-editing/meme.js +++ b/commands/image-editing/meme.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class MemeCommand extends MediaCommand { @@ -41,11 +40,11 @@ class MemeCommand extends MediaCommand { { name: "case", description: "Make the meme text case-sensitive (allows for lowercase text)", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }, { name: "font", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", choices: (() => { const array = []; for (const font of this.allowedFonts) { diff --git a/commands/image-editing/motivate.js b/commands/image-editing/motivate.js index 4edc7235..64cb1220 100644 --- a/commands/image-editing/motivate.js +++ b/commands/image-editing/motivate.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class MotivateCommand extends MediaCommand { @@ -39,7 +38,7 @@ class MotivateCommand extends MediaCommand { this.addTextParam(); this.flags.push({ name: "font", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", choices: (() => { const array = []; for (const font of this.allowedFonts) { diff --git a/commands/image-editing/slide.js b/commands/image-editing/slide.js index c1f159aa..e9d9802b 100644 --- a/commands/image-editing/slide.js +++ b/commands/image-editing/slide.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class SlideCommand extends MediaCommand { @@ -16,13 +15,13 @@ class SlideCommand extends MediaCommand { this.flags.push( { name: "vertical", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", description: "Slides the image vertically", classic: true, }, { name: "reverse", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", description: "Changes the direction the image slides in", classic: true, }, diff --git a/commands/image-editing/slow.js b/commands/image-editing/slow.js index 50f32015..a4a8edf2 100644 --- a/commands/image-editing/slow.js +++ b/commands/image-editing/slow.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class SlowCommand extends MediaCommand { @@ -14,7 +13,7 @@ class SlowCommand extends MediaCommand { super.init(); this.flags.push({ name: "multiplier", - type: Constants.ApplicationCommandOptionTypes.NUMBER, + type: "number", description: "Set the speed multiplier (default: 2.0)", minValue: 1, maxValue: 1000, diff --git a/commands/image-editing/snapchat.js b/commands/image-editing/snapchat.js index ba8f30e5..4d12efd7 100644 --- a/commands/image-editing/snapchat.js +++ b/commands/image-editing/snapchat.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class SnapchatCommand extends MediaCommand { @@ -19,7 +18,7 @@ class SnapchatCommand extends MediaCommand { this.addTextParam(); this.flags.push({ name: "position", - type: Constants.ApplicationCommandOptionTypes.NUMBER, + type: "number", description: "Set the position of the caption as a decimal (0.0 is top, 1.0 is bottom, default is 0.565)", minValue: 0, maxValue: 1, diff --git a/commands/image-editing/speechbubble.js b/commands/image-editing/speechbubble.js index 33e7d1bc..1b3f26ed 100644 --- a/commands/image-editing/speechbubble.js +++ b/commands/image-editing/speechbubble.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class SpeechBubbleCommand extends MediaCommand { @@ -23,22 +22,22 @@ class SpeechBubbleCommand extends MediaCommand { { name: "alpha", description: "Make the top of the speech bubble transparent", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }, { name: "flip", description: "Flips the speech bubble", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }, { name: "bottom", description: "Puts the speech bubble on the bottom of the image", - type: Constants.ApplicationCommandOptionTypes.BOOLEAN, + type: "boolean", }, { name: "scale", description: "A multiplier to resize the speech bubble (0.01 is smallest, 1.0 is largest, default is 0.2)", - type: Constants.ApplicationCommandOptionTypes.NUMBER, + type: "number", minValue: 0.01, maxValue: 1.0, }, diff --git a/commands/image-editing/speed.js b/commands/image-editing/speed.js index 9a3188d6..55ab59c3 100644 --- a/commands/image-editing/speed.js +++ b/commands/image-editing/speed.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class SpeedCommand extends MediaCommand { @@ -13,7 +12,7 @@ class SpeedCommand extends MediaCommand { super.init(); this.flags.push({ name: "multiplier", - type: Constants.ApplicationCommandOptionTypes.NUMBER, + type: "number", description: "Set the speed multiplier (default: 2.0)", minValue: 1, maxValue: 1000, diff --git a/commands/image-editing/uncanny.js b/commands/image-editing/uncanny.js index 39fbcbdf..40ea4d2f 100644 --- a/commands/image-editing/uncanny.js +++ b/commands/image-editing/uncanny.js @@ -1,7 +1,6 @@ import { readdirSync } from "node:fs"; import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; import { random } from "#utils/misc.js"; const prompts = [ @@ -54,7 +53,7 @@ class UncannyCommand extends MediaCommand { this.flags.push( { name: "font", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", choices: (() => { const array = []; for (const font of this.allowedFonts) { @@ -66,7 +65,7 @@ class UncannyCommand extends MediaCommand { }, { name: "phase", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", choices: (() => { const array = []; for (const name of names) { diff --git a/commands/image-editing/uncaption.js b/commands/image-editing/uncaption.js index 82595b3c..9d204158 100644 --- a/commands/image-editing/uncaption.js +++ b/commands/image-editing/uncaption.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class UncaptionCommand extends MediaCommand { @@ -13,7 +12,7 @@ class UncaptionCommand extends MediaCommand { super.init(); this.flags.push({ name: "tolerance", - type: Constants.ApplicationCommandOptionTypes.NUMBER, + type: "number", description: "Set the shade tolerance for the caption detection (0.0 is highest, 1.0 is lowest, default is 0.95)", minValue: 0, maxValue: 1, diff --git a/commands/image-editing/wide.js b/commands/image-editing/wide.js index bbd9c481..c0106fb0 100644 --- a/commands/image-editing/wide.js +++ b/commands/image-editing/wide.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MediaCommand from "#cmd-classes/mediaCommand.js"; class WideCommand extends MediaCommand { @@ -15,7 +14,7 @@ class WideCommand extends MediaCommand { this.flags.push({ name: "scale", description: "The amount to widen the image by (1 is smallest, 19 is largest, default is 19)", - type: Constants.ApplicationCommandOptionTypes.INTEGER, + type: "integer", minValue: 1, maxValue: 19, }); diff --git a/commands/music/music/host.js b/commands/music/music/host.js index 0f779f41..722830df 100644 --- a/commands/music/music/host.js +++ b/commands/music/music/host.js @@ -1,5 +1,5 @@ import process from "node:process"; -import { Constants, User } from "oceanic.js"; +import { User } from "oceanic.js"; import MusicCommand from "#cmd-classes/musicCommand.js"; import logger from "#utils/logger.js"; import { safeBigInt } from "#utils/misc.js"; @@ -65,7 +65,7 @@ class MusicHostCommand extends MusicCommand { static flags = [ { name: "user", - type: Constants.ApplicationCommandOptionTypes.USER, + type: "user", description: "The user you want the new host to be", classic: true, }, diff --git a/commands/music/music/play.js b/commands/music/music/play.js index 8cd0fb1e..32a652a4 100644 --- a/commands/music/music/play.js +++ b/commands/music/music/play.js @@ -1,4 +1,4 @@ -import { Constants, GuildChannel } from "oceanic.js"; +import { GuildChannel } from "oceanic.js"; import MusicCommand from "#cmd-classes/musicCommand.js"; import { play } from "#utils/soundplayer.js"; const prefixes = ["scsearch:", "spsearch:", "sprec:", "amsearch:", "dzsearch:", "dzisrc:", "ytsearch:", "ytmsearch:"]; @@ -56,7 +56,7 @@ class MusicPlayCommand extends MusicCommand { static flags = [ { name: "query", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "An audio search query or URL", classic: true, required: true, diff --git a/commands/music/music/remove.js b/commands/music/music/remove.js index 91758931..a39ee671 100644 --- a/commands/music/music/remove.js +++ b/commands/music/music/remove.js @@ -1,5 +1,4 @@ import process from "node:process"; -import { Constants } from "oceanic.js"; import MusicCommand from "#cmd-classes/musicCommand.js"; import { queues } from "#utils/soundplayer.js"; @@ -26,7 +25,7 @@ class MusicRemoveCommand extends MusicCommand { static flags = [ { name: "position", - type: Constants.ApplicationCommandOptionTypes.INTEGER, + type: "integer", description: "The queue position you want to remove", minValue: 1, required: true, diff --git a/commands/music/music/seek.js b/commands/music/music/seek.js index bd9b7b6a..d572fd25 100644 --- a/commands/music/music/seek.js +++ b/commands/music/music/seek.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MusicCommand from "#cmd-classes/musicCommand.js"; class MusicSeekCommand extends MusicCommand { @@ -30,7 +29,7 @@ class MusicSeekCommand extends MusicCommand { static flags = [ { name: "position", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "Seek to this position", required: true, classic: true, diff --git a/commands/music/music/volume.js b/commands/music/music/volume.js index 46823fde..4e90d4f2 100644 --- a/commands/music/music/volume.js +++ b/commands/music/music/volume.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import MusicCommand from "#cmd-classes/musicCommand.js"; class MusicVolumeCommand extends MusicCommand { @@ -20,7 +19,7 @@ class MusicVolumeCommand extends MusicCommand { static flags = [ { name: "level", - type: Constants.ApplicationCommandOptionTypes.INTEGER, + type: "integer", description: "The volume level", minValue: 0, maxValue: 100, diff --git a/commands/tags/tags/add.js b/commands/tags/tags/add.js index 289173ae..f887242c 100644 --- a/commands/tags/tags/add.js +++ b/commands/tags/tags/add.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; const blacklist = ["create", "add", "edit", "remove", "delete", "list", "random", "own", "owner"]; @@ -43,14 +42,14 @@ class TagsAddCommand extends Command { static flags = [ { name: "name", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The name of the tag", required: true, classic: true, }, { name: "content", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The content of the tag", required: true, classic: true, diff --git a/commands/tags/tags/delete.js b/commands/tags/tags/delete.js index 68c1b3df..49b8e2b0 100644 --- a/commands/tags/tags/delete.js +++ b/commands/tags/tags/delete.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class TagsDeleteCommand extends Command { @@ -29,7 +28,7 @@ class TagsDeleteCommand extends Command { static flags = [ { name: "name", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The name of the tag", required: true, classic: true, diff --git a/commands/tags/tags/edit.js b/commands/tags/tags/edit.js index 75e73242..c607634e 100644 --- a/commands/tags/tags/edit.js +++ b/commands/tags/tags/edit.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class TagsEditCommand extends Command { @@ -37,14 +36,14 @@ class TagsEditCommand extends Command { static flags = [ { name: "name", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The name of the tag", required: true, classic: true, }, { name: "content", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The content of the tag", required: true, classic: true, diff --git a/commands/tags/tags/get.js b/commands/tags/tags/get.js index 35758acc..cb85bc93 100644 --- a/commands/tags/tags/get.js +++ b/commands/tags/tags/get.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class TagsGetCommand extends Command { @@ -28,7 +27,7 @@ class TagsGetCommand extends Command { static flags = [ { name: "name", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The name of the tag", required: true, classic: true, diff --git a/commands/tags/tags/owner.js b/commands/tags/tags/owner.js index 76c11466..5ca9761b 100644 --- a/commands/tags/tags/owner.js +++ b/commands/tags/tags/owner.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; class TagsOwnerCommand extends Command { @@ -41,7 +40,7 @@ class TagsOwnerCommand extends Command { static flags = [ { name: "name", - type: Constants.ApplicationCommandOptionTypes.STRING, + type: "string", description: "The name of the tag", required: true, classic: true, diff --git a/commands/tags/tags/role.js b/commands/tags/tags/role.js index 6a86a1a0..380a5853 100644 --- a/commands/tags/tags/role.js +++ b/commands/tags/tags/role.js @@ -1,4 +1,3 @@ -import { Constants } from "oceanic.js"; import paginator from "#pagination"; import { mentionToObject } from "#utils/mentions.js"; import TagsGetCommand from "./get.js"; @@ -130,12 +129,12 @@ class TagsRoleCommand extends TagsGetCommand { static flags = [ { name: "add", - type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND, + type: "subcommand", description: "Allow a role to manage tags", options: [ { name: "role", - type: Constants.ApplicationCommandOptionTypes.ROLE, + type: "role", description: "The role to add", required: true, classic: true, @@ -144,12 +143,12 @@ class TagsRoleCommand extends TagsGetCommand { }, { name: "remove", - type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND, + type: "subcommand", description: "Remove a role from the allowlist", options: [ { name: "role", - type: Constants.ApplicationCommandOptionTypes.ROLE, + type: "role", description: "The role to remove", required: true, classic: true, @@ -158,7 +157,7 @@ class TagsRoleCommand extends TagsGetCommand { }, { name: "list", - type: Constants.ApplicationCommandOptionTypes.SUB_COMMAND, + type: "subcommand", description: "List the roles that are capable of managing tags", }, ]; -- 2.51.2