refactor/declare command option types

This commit is contained in:
SowinskiBraeden committed 2023-09-10 00:41:45 -07:00
1 parent 28737c5756
commit ab2b59ff11
18 files changed
+170 -128

No files matched your search

+34 -21
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const bitfieldCalculator = require('discord-bitfield-calculator');
const { BanPlayer, UnbanPlayer, RestartServer, CheckServerStatus } = require('../util/NitradoAPI');
const { Armbands } = require('../config/armbandsdb.js');
@@ -17,92 +18,92 @@ module.exports = {
name: "gamertag-link",
description: "link a gamertag for a user",
value: "gamertag-link",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "user",
description: "User to link gamertag to",
value: "user",
type: 6,
type: CommandOptions.User,
required: true,
},
{
name: "gamertag",
description: "Gamertag of player",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}]
}, {
name: "gamertag-unlink",
description: "unlink a gamertag for a user",
value: "gamertag-unlink",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "user",
description: "User to link gamertag to",
value: "user",
type: 6,
type: CommandOptions.User,
required: true,
}]
}, {
name: "claim-armband",
description: "Claim an armband for a faction",
value: "claim-armband",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "faction_role",
description: "Claim an armband for this faction role.",
value: "faction_role",
type: 8,
type: CommandOptions.Role,
required: true,
}]
}, {
name: "bounty-clear",
description: "clear a bounty off a player",
value: "bounty-clear",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "Gamertag of player",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}]
}, {
name: "ban-player",
description: "Ban a player from the DayZ server",
value: "ban-player",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "gamertag of the player to ban.",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}]
}, {
name: "unban-player",
description: "Unban a player from the DayZ server",
value: "unban-player",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "gamertag of the player to unban.",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}]
}, {
name: "add-money",
description: "Add money to user",
value: "add",
type: 1,
type: CommandOptions.SubCommand,
options: [
{
name: "amount",
description: "The amount to add to balance",
value: "amount",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
@@ -110,7 +111,7 @@ module.exports = {
name: "to",
description: "User to alter balance",
value: "to",
type: 6,
type: CommandOptions.User,
required: true,
},
]
@@ -119,13 +120,13 @@ module.exports = {
name: "remove-money",
description: "Remove or remove money from a user",
value: "remove",
type: 1,
type: CommandOptions.SubCommand,
options: [
{
name: "amount",
description: "The amount to add to balance",
value: "amount",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
@@ -133,7 +134,7 @@ module.exports = {
name: "from",
description: "User to alter balance",
value: "from",
type: 6,
type: CommandOptions.User,
required: true,
},
]
@@ -141,12 +142,24 @@ module.exports = {
name: "restart",
description: "Restart the DayZ Server",
value: "restart",
type: 1,
type: CommandOptions.SubCommand,
}, {
name: "auto-restart",
description: "Enable/Disable periodic server checks and restart if stopped.",
value: "auto-restart",
type: 1,
type: CommandOptions.SubCommand,
}, {
name: "combat-log-timer",
description: "Set the number of minutes to elapse for a player to not combat log. (Set to 0 to disbable combat logging detection)",
value: "combat-log-timer",
type: CommandOptions.SubCommand,
options: [{
name: "minutes",
description: "Minutes to qualify combat log",
value: 5,
type: CommandOptions.Integer, // Integer
}]
}],
SlashCommand: {
/**
+25 -24
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const bitfieldCalculator = require('discord-bitfield-calculator');
module.exports = {
@@ -16,13 +17,13 @@ module.exports = {
name: "create",
description: "Create a new Zone Ping Alarm",
value: "create",
type: 1,
type: CommandOptions.SubCommand,
options: [
{
name: "x-coord",
description: "X Coordinate of the origin",
value: "x-coord",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
@@ -30,7 +31,7 @@ module.exports = {
name: "y-coord",
description: "Y Coordinate of the origin",
value: "y-coord",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
@@ -38,7 +39,7 @@ module.exports = {
name: "radius",
description: "Radius of Zone Alarm",
value: "radius",
type: 10,
type: CommandOptions.Float,
min_value: 25.00,
required: true,
},
@@ -46,14 +47,14 @@ module.exports = {
name: "name",
description: "Zone Alarm Name",
value: "name",
type: 3,
type: CommandOptions.String,
required: true,
},
{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
},
@@ -61,21 +62,21 @@ module.exports = {
name: "role",
description: "Role to Ping on Zone Alarm",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
},
{
name: "emp-exempt",
description: "Is this Alarm Exempt to EMP Attacks?",
value: false,
type: 5,
type: CommandOptions.Boolean,
required: false,
},
{
name: "show-player-coords",
description: "Show a players coords when in the zone",
value: true,
type: 5,
type: CommandOptions.Boolean,
required: false,
}
]
@@ -84,18 +85,18 @@ module.exports = {
name: "delete",
description: "Delete a Zone Alarm",
value: "delete",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "add-player",
description: "Add Player to be Ignored in a Zone Alarm Pings",
value: "add-player",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "Gamertag of Player to Ignore",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}]
},
@@ -103,12 +104,12 @@ module.exports = {
name: "remove-player",
description: "Remove a Player from being Ignored in a Zone Alarm Pings",
value: "remove-player",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "Gamertag of Player to Ignore",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}]
},
@@ -116,24 +117,24 @@ module.exports = {
name: "disable",
description: "Disable an Zone Alarm",
value: "disable",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "enable",
description: "Enable an Zone Alarm",
value: "enable",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "set-rule",
description: "Add a Rule to an Alarm",
value: "set-rule",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "rule",
description: "Rule to Add to an Alarm",
value: "rule",
type: 3,
type: CommandOptions.String,
required: true,
choices: [
{ name: 'Ban on Entry', value: 'ban_on_entry' },
@@ -145,18 +146,18 @@ module.exports = {
name: "remove-rule",
description: "Remove a Rule from an Alarm",
value: "remove-rule",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "rename",
description: "Rename an Alarm",
value: "rename",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "name",
description: "New Alarm Name",
value: "name",
type: 3,
type: CommandOptions.String,
required: true,
}]
},
@@ -164,12 +165,12 @@ module.exports = {
name: "move-origin",
description: "Move an alarms origin to new coordinates",
value: "move-origin",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "x-coord",
description: "X Coordinate of the origin",
value: "x-coord",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
@@ -177,7 +178,7 @@ module.exports = {
name: "y-coord",
description: "Y Coordinate of the origin",
value: "y-coord",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
}]
+6 -5
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const { User, addUser } = require('../structures/user');
module.exports = {
@@ -16,12 +17,12 @@ module.exports = {
name: "balance",
description: "View your bank balance and count your cash",
value: "balance",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "user",
description: "User to view ballance",
value: "user",
type: 6,
type: CommandOptions.User,
required: false,
}]
},
@@ -29,20 +30,20 @@ module.exports = {
name: "transfer",
description: "Transfer directly to users bank",
value: "transfer",
type: 1,
type: CommandOptions.SubCommand,
options: [
{
name: "user",
description: "User to transfer to",
value: "user",
type: 6,
type: CommandOptions.User,
required: true,
},
{
name: "amount",
description: "The amount to transfer",
value: "amount",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
+7 -6
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
module.exports = {
name: "bounty",
@@ -14,37 +15,37 @@ module.exports = {
name: "set",
description: "Set a bounty on a player",
value: "set",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "Gamertag of player for bounty",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}, {
name: "value",
description: "Amount of the bounty",
value: "value",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true
}, {
name: "anonymous",
description: "Make this bounty anonymous",
value: false,
type: 5,
type: CommandOptions.Boolean,
required: false
}]
}, {
name: "pay",
description: "Pay off your bounty (double price)",
value: "pay",
type: 1,
type: CommandOptions.SubCommand,
}, {
name: "view",
description: "View all active bounties",
value: "view",
type: 1,
type: CommandOptions.SubCommand,
}],
SlashCommand: {
/**
+2 -1
View File
@@ -1,4 +1,5 @@
const { ActionRowBuilder, EmbedBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const { Armbands } = require('../config/armbandsdb.js');
module.exports = {
@@ -15,7 +16,7 @@ module.exports = {
name: "faction_role",
description: "Claim an armband for this faction role.",
value: "faction_role",
type: 8,
type: CommandOptions.Role,
required: true,
}],
SlashCommand: {
+44 -43
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const bitfieldCalculator = require('discord-bitfield-calculator');
module.exports = {
@@ -16,18 +17,18 @@ module.exports = {
name: "allowed_channels",
description: "Set channels you're allowed to use the bot in",
value: "allowed_channels",
type: 2,
type: CommandOptions.SubCommandGroup,
options: [
{
name: "add",
description: "Add channel",
value: "add",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
}]
@@ -36,12 +37,12 @@ module.exports = {
name: "remove",
description: "Remove channel",
value: "remove",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
}]
@@ -52,12 +53,12 @@ module.exports = {
name: "killfeed_channel",
description: "Set the Killfeed Channel",
value: "killfeed_channel",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
}]
@@ -66,12 +67,12 @@ module.exports = {
name: "admin_logs_channel",
description: "Set the Admin Logs Channel",
value: "admin_logs_channel",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
}]
@@ -80,12 +81,12 @@ module.exports = {
name: "welcome_channel",
description: "Set the channel for users to gain access",
value: "welcome_channel",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
}]
@@ -94,12 +95,12 @@ module.exports = {
name: "active_players_channel",
description: "Set the channel for active players update",
value: "active_players_channel",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "channel",
description: "The channel to configure",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
}]
@@ -108,12 +109,12 @@ module.exports = {
name: "linked_gt_role",
description: "Access Role to give to users",
value: "linked_gt_role",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "role",
description: "Role to configure",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
}]
},
@@ -121,12 +122,12 @@ module.exports = {
name: "member_role",
description: "Role to give users when they join.",
value: "member_role",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "role",
description: "Role to configure",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
}]
},
@@ -134,13 +135,13 @@ module.exports = {
name: "bot_admin_role",
description: "Set/remove bot admin role",
value: "bot_admin_role",
type: 1,
type: CommandOptions.SubCommand,
options: [
{
name: "action",
description: "Add or remove a role from the exclude list.",
value: "action",
type: 3,
type: CommandOptions.String,
choices: [
{ name: 'add', value: 'add' }, { name: 'remove', value: 'remove' },
],
@@ -150,7 +151,7 @@ module.exports = {
name: "role",
description: "Role to configure",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
},
]
@@ -159,12 +160,12 @@ module.exports = {
name: "admin_role",
description: "Discord Server's dedicated admin role",
value: "admin_role",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "role",
description: "Role to configure",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
}]
},
@@ -172,13 +173,13 @@ module.exports = {
name: "exclude",
description: "Exclude roles from users to use to claim a flag.",
value: "exclude",
type: 1,
type: CommandOptions.SubCommand,
options: [
{
name: "action",
description: "Add or remove a role from the exclude list.",
value: "action",
type: 3,
type: CommandOptions.String,
choices: [
{ name: 'add', value: 'add' }, { name: 'remove', value: 'remove' },
],
@@ -188,7 +189,7 @@ module.exports = {
name: "role",
description: "The role to manage",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
},
]
@@ -197,24 +198,24 @@ module.exports = {
name: "reset",
description: "Restore all settings to default configurations",
value: "reset",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "view",
description: "View current settings configuration",
value: "view",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "starting_balance",
description: "Set the starting balance",
value: "starting_balance",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "amount",
description: "The amount to set the starting balance",
value: "amount",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
}]
@@ -223,12 +224,12 @@ module.exports = {
name: "uav-price",
description: "Configure the price of a UAV",
value: "uav-price",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "amount",
description: "The amount to set the UAV price",
value: "amount",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
}]
@@ -237,12 +238,12 @@ module.exports = {
name: "emp-price",
description: "Configure the price of an EMP",
value: "emp-price",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "amount",
description: "The amount to set the EMP price",
value: "amount",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
}]
@@ -251,26 +252,26 @@ module.exports = {
name: "income_role",
description: "Add/update a role to earn income on /collect-income command",
value: "set_income_role",
type: 2,
type: CommandOptions.SubCommandGroup,
options: [
{
name: "set",
description: "Set role",
value: "set",
type: 1,
type: CommandOptions.SubCommand,
options: [
{
name: "role",
description: "Role to set",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
},
{
name: "amount",
description: "The amount to collect",
value: 120.00,
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
}
@@ -280,12 +281,12 @@ module.exports = {
name: "remove",
description: "Remove role",
value: "remove",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "role",
description: "Role to remove",
value: "role",
type: 8,
type: CommandOptions.Role,
required: true,
}]
},
@@ -295,12 +296,12 @@ module.exports = {
name: "income_limiter",
description: "Change the number of hours to wait before collecting income",
value: "income_limiter",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "hours",
description: "Number of hours till income can be collected",
value: 168.00, // 1 week
type: 10,
type: CommandOptions.Float,
required: true,
}]
},
@@ -308,12 +309,12 @@ module.exports = {
name: "show_killfeed_coords",
description: "Show the coordinates of the killer or victim in the killfeed channel.",
value: "show_killfeed_coords",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "configuration",
description: "True or False",
value: false,
type: 5,
type: CommandOptions.Boolean,
required: true,
}]
}
+7 -6
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const bitfieldCalculator = require('discord-bitfield-calculator');
module.exports = {
@@ -15,19 +16,19 @@ module.exports = {
name: "player-track",
description: "track a player and announce location",
value: "player-track",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "Gamertag of player",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
},
{
name: "time",
description: "duration of tracking",
value: "time",
type: 4,
type: CommandOptions.Integer,
required: true,
choices: [
{ name: '30-minutes', value: 30 }, { name: '60-minutes', value: 60 }, { name: '90-minutes', value: 90 }, { name: '120-minutes', value: 120 },
@@ -37,14 +38,14 @@ module.exports = {
name: "event-name",
description: "name of the event",
value: "event-name",
type: 3,
type: CommandOptions.String,
required: true,
},
{
name: "channel",
description: "channel to host event",
value: "channel",
type: 7,
type: CommandOptions.Channel,
channel_types: [0], // Restrict to text channel
required: true,
}]
@@ -52,7 +53,7 @@ module.exports = {
name: "delete",
description: "delete an active event",
value: "delete",
type: 1
type: CommandOptions.SubCommand
}],
SlashCommand: {
/**
+2 -1
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const { Armbands } = require('../config/armbandsdb.js');
module.exports = {
@@ -15,7 +16,7 @@ module.exports = {
name: "faction_role",
description: "View a specific faction's armband by role",
value: "faction_role",
type: 8,
type: CommandOptions.Role,
required: false,
}],
SlashCommand: {
+2 -1
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
module.exports = {
name: "gamertag-link",
@@ -14,7 +15,7 @@ module.exports = {
name: "gamertag",
description: "Gamertag of player",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}],
SlashCommand: {
+6 -5
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require("discord.js");
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
module.exports = {
name: "help",
@@ -15,12 +16,12 @@ module.exports = {
name: "commands",
description: "List all commands",
value: "commands",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "command",
description: "Get information on a specific command",
value: "command",
type: 3,
type: CommandOptions.String,
required: false,
}]
},
@@ -28,19 +29,19 @@ module.exports = {
name: "support",
description: "Get support for Applicatz",
value: "support",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "credits",
description: "DayZR Bot Credits",
value: "credits",
type: 1,
type: CommandOptions.SubCommand,
},
{
name: "stats",
description: "Current Bot Statistics",
value: "stats",
type: 1,
type: CommandOptions.SubCommand,
}
],
SlashCommand: {
+3 -2
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
module.exports = {
name: "leaderboard",
@@ -14,7 +15,7 @@ module.exports = {
name: "category",
description: "Leaderboard Category",
value: "category",
type: 3,
type: CommandOptions.String,
required: true,
choices: [
{ name: "money", value: "money" },
@@ -33,7 +34,7 @@ module.exports = {
name: "limit",
description: "leaderboard limit",
value: "limit",
type: 4,
type: CommandOptions.Integer,
min_value: 1,
max_value: 25,
required: true,
+5 -4
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
module.exports = {
name: "lookup",
@@ -14,24 +15,24 @@ module.exports = {
name: "discord",
description: "Find a Discord user from a Gamertag",
value: "discord",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "gamertag",
description: "Gamertag of player",
value: "gamertag",
type: 3,
type: CommandOptions.String,
required: true,
}]
}, {
name: "gamertag",
description: "Find a Gamertag from a Discord user",
value: "gamertag",
type: 1,
type: CommandOptions.SubCommand,
options: [{
name: "user",
description: "Discord User",
value: "user",
type: 6,
type: CommandOptions.User,
required: true,
}]
}],
+4 -3
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
module.exports = {
name: "player-stats",
@@ -14,7 +15,7 @@ module.exports = {
name: "category",
description: "Leaderboard Category",
value: "category",
type: 3,
type: CommandOptions.String,
required: true,
choices: [
{ name: "money", value: "money" },
@@ -33,12 +34,12 @@ module.exports = {
name: "discord",
description: "discord user to lookup stats",
value: "discord",
type: 6,
type: CommandOptions.User,
required: false,
}, {
name: "gamertag",
description: "gamertag to lookup stats",
type: 3,
type: CommandOptions.String,
required: false,
}],
SlashCommand: {
+3 -2
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const { User, addUser } = require('../structures/user')
module.exports = {
@@ -16,7 +17,7 @@ module.exports = {
name: "x-coord",
description: "X Coordinate of the origin",
value: "x-coord",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
@@ -24,7 +25,7 @@ module.exports = {
name: "y-coord",
description: "Y Coordinate of the origin",
value: "y-coord",
type: 10,
type: CommandOptions.Float,
min_value: 0.01,
required: true,
},
+2 -1
View File
@@ -1,4 +1,5 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const CommandOptions = require('../util/CommandOptionTypes').CommandOptionTypes;
const { addUser } = require('../structures/user');
const bitfieldCalculator = require('discord-bitfield-calculator');
@@ -16,7 +17,7 @@ module.exports = {
name: "user",
description: "User to reset",
value: "user",
type: 6,
type: CommandOptions.User,
required: true,
}],
SlashCommand: {
+1 -1
View File
@@ -27,7 +27,7 @@ module.exports = {
mongoURI: process.env.mongoURI || "mongodb://localhost:27017",
dbo: process.env.dbo || "knoldus",
Presence: {
type: 3, // Watching, Playing = 0, Streaming = 1, Listening = 2, Custom = 4, Competing = 5
type: CommandOptions.String, // Watching, Playing = 0, Streaming = 1, Listening = 2, Custom = 4, Competing = 5
name: "DayZ Logs", // What message you want after type
status: "online", // You can show either "idle", "dnd", "online", or "offline"
},
+2 -2
View File
@@ -78,7 +78,7 @@ class DayzRBot extends Client {
return await rest.post(Routes.interactionCallback(interaction.id, interaction.token), {
body: {
type: 4,
type: CommandOptions.Integer,
data: message,
}
});
@@ -391,7 +391,7 @@ class DayzRBot extends Client {
autoRestart: 0,
allowedChannels: [],
killfeedChannel: "",
showKillfeedCoords: false,
showKillfeedCoords: 0,
connectionLogsChannel: "",
activePlayersChannel: "",
welcomeChannel: "",
+15
View File
@@ -0,0 +1,15 @@
module.exports = {
CommandOptionTypes: {
SubCommand: 1,
SubCommandGroup: 2,
String: 3,
Integer: 4,
Boolean: 5,
User: 6,
Channel: 7,
Role: 8,
Mentionable: 9,
Float: 10, // AKA Number in Discord's Documentation
Attachment: 11,
}
};