From 0a78c92d6308b8319c3f5e8eb1cb9163791d7fbb Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Sat, 27 Jan 2024 15:01:45 -0800 Subject: [PATCH] refactor/tidy command descriptions --- commands/alarm.js | 40 ++++++++++++++++++------------------- commands/armbands.js | 2 +- commands/bank.js | 4 ++-- commands/bounty.js | 4 ++-- commands/claim.js | 2 +- commands/compare-rating.js | 6 +++--- commands/config.js | 23 +++++++++++---------- commands/debug.js | 31 ---------------------------- commands/event.js | 10 +++++----- commands/help.js | 20 ++++++++++--------- commands/leaderboard.js | 4 ++-- commands/lookup.js | 2 +- commands/ping.js | 31 ---------------------------- commands/purchase-uav.js | 2 +- commands/reset.js | 2 +- commands/server.js | 4 ++-- commands/stats.js | 41 -------------------------------------- commands/weapon-stats.js | 8 ++++---- package.json | 2 +- 19 files changed, 69 insertions(+), 169 deletions(-) delete mode 100644 commands/ping.js delete mode 100644 commands/stats.js diff --git a/commands/alarm.js b/commands/alarm.js index 5dd46df..8a01c1a 100644 --- a/commands/alarm.js +++ b/commands/alarm.js @@ -6,7 +6,7 @@ module.exports = { name: "alarm", debug: false, global: false, - description: "Create a Zone Ping Alarm", + description: "Manage an Alarm", usage: "[command] [options]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], @@ -37,7 +37,7 @@ module.exports = { }, { name: "radius", - description: "Radius of Zone Alarm", + description: "Radius of Alarm", value: "radius", type: CommandOptions.Float, min_value: 25.00, @@ -45,14 +45,14 @@ module.exports = { }, { name: "name", - description: "Zone Alarm Name", + description: "Alarm Name", value: "name", type: CommandOptions.String, required: true, }, { name: "channel", - description: "The channel to configure", + description: "Alarm Channel", value: "channel", type: CommandOptions.Channel, channel_types: [0], // Restrict to text channel @@ -60,7 +60,7 @@ module.exports = { }, { name: "role", - description: "Role to Ping on Zone Alarm", + description: "Role to Ping on Alarm", value: "role", type: CommandOptions.Role, required: true, @@ -74,7 +74,7 @@ module.exports = { }, { name: "show-player-coords", - description: "Show a players coords when in the zone", + description: "Show a players coords when in the radius of the Alarm?", value: true, type: CommandOptions.Boolean, required: false, @@ -83,18 +83,18 @@ module.exports = { }, { name: "delete", - description: "Delete a Zone Alarm", + description: "Delete an Alarm", value: "delete", type: CommandOptions.SubCommand, }, { name: "add-player", - description: "Add Player to be Ignored in a Zone Alarm Pings", + description: "Add player to be ignored list of an Alarm", value: "add-player", type: CommandOptions.SubCommand, options: [{ name: "gamertag", - description: "Gamertag of Player to Ignore", + description: "Gamertag of player to ignore", value: "gamertag", type: CommandOptions.String, required: true, @@ -102,12 +102,12 @@ module.exports = { }, { name: "remove-player", - description: "Remove a Player from being Ignored in a Zone Alarm Pings", + description: "Remove a player from the ignored list of an Alarm", value: "remove-player", type: CommandOptions.SubCommand, options: [{ name: "gamertag", - description: "Gamertag of Player to Ignore", + description: "Gamertag of player to ignore", value: "gamertag", type: CommandOptions.String, required: true, @@ -115,24 +115,24 @@ module.exports = { }, { name: "disable", - description: "Disable an Zone Alarm", + description: "Disable an Alarm", value: "disable", type: CommandOptions.SubCommand, }, { name: "enable", - description: "Enable an Zone Alarm", + description: "Enable an Alarm", value: "enable", type: CommandOptions.SubCommand, }, { name: "mute", - description: "Toggle mute on this alarm", + description: "Mute the role ping of an Alarm", value: "mute", type: CommandOptions.SubCommand, options: [{ name: "toggle", - description: "Turn on or off role pings for this alarm", + description: "Turn on/off role pings for this alarm", value: false, type: CommandOptions.Boolean, required: true, @@ -145,7 +145,7 @@ module.exports = { type: CommandOptions.SubCommand, options: [{ name: "rule", - description: "Rule to Add to an Alarm", + description: "Select a rule to add to an Alarm", value: "rule", type: CommandOptions.String, required: true, @@ -158,7 +158,7 @@ module.exports = { }, { name: "remove-rule", - description: "Remove a Rule from an Alarm", + description: "Remove a rule from an Alarm", value: "remove-rule", type: CommandOptions.SubCommand, }, @@ -177,12 +177,12 @@ module.exports = { }, { name: "move-origin", - description: "Move an alarms origin to new coordinates", + description: "Move the origin of an Alarm", value: "move-origin", type: CommandOptions.SubCommand, options: [{ name: "x-coord", - description: "X Coordinate of the origin", + description: "X Coordinate of the new origin", value: "x-coord", type: CommandOptions.Float, min_value: 0.01, @@ -190,7 +190,7 @@ module.exports = { }, { name: "y-coord", - description: "Y Coordinate of the origin", + description: "Y Coordinate of the new origin", value: "y-coord", type: CommandOptions.Float, min_value: 0.01, diff --git a/commands/armbands.js b/commands/armbands.js index ceda096..10fb4d3 100644 --- a/commands/armbands.js +++ b/commands/armbands.js @@ -5,7 +5,7 @@ module.exports = { name: "armbands", debug: false, global: false, - description: "View a list of armbads", + description: "View a list of armbads and what their image", usage: "", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], diff --git a/commands/bank.js b/commands/bank.js index f6af2c5..ec150c1 100644 --- a/commands/bank.js +++ b/commands/bank.js @@ -15,7 +15,7 @@ module.exports = { options: [ { name: "balance", - description: "View your bank balance and count your cash", + description: "View your bank balance", value: "balance", type: CommandOptions.SubCommand, options: [{ @@ -28,7 +28,7 @@ module.exports = { }, { name: "transfer", - description: "Transfer directly to users bank", + description: "Transfer money to another user", value: "transfer", type: CommandOptions.SubCommand, options: [ diff --git a/commands/bounty.js b/commands/bounty.js index 6988cfe..552a966 100644 --- a/commands/bounty.js +++ b/commands/bounty.js @@ -33,14 +33,14 @@ module.exports = { required: true }, { name: "anonymous", - description: "Make this bounty anonymous", + description: "Make this bounty anonymous (does not show your name)", value: false, type: CommandOptions.Boolean, required: false }] }, { name: "pay", - description: "Pay off your bounty (double price)", + description: "Pay off your bounty", value: "pay", type: CommandOptions.SubCommand, }, { diff --git a/commands/claim.js b/commands/claim.js index d3006e5..bbe188e 100644 --- a/commands/claim.js +++ b/commands/claim.js @@ -14,7 +14,7 @@ module.exports = { }, options: [{ name: "faction_role", - description: "Claim an armband for this faction role.", + description: "Claim an armband for this faction role", value: "faction_role", type: CommandOptions.Role, required: true, diff --git a/commands/compare-rating.js b/commands/compare-rating.js index 80902b5..22cfb0f 100644 --- a/commands/compare-rating.js +++ b/commands/compare-rating.js @@ -6,7 +6,7 @@ module.exports = { name: "compare-rating", debug: false, global: false, - description: "Compare combat ratings", + description: "Compare combat ratings between yourself and another player", usage: "[user or gamertag]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], @@ -14,13 +14,13 @@ module.exports = { }, options: [{ name: "discord", - description: "discord user to lookup stats", + description: "Discord user to lookup stats", value: "discord", type: CommandOptions.User, required: false, }, { name: "gamertag", - description: "gamertag to lookup stats", + description: "Gamertag to lookup stats", type: CommandOptions.String, required: false, }], diff --git a/commands/config.js b/commands/config.js index b5dbeb3..acce583 100644 --- a/commands/config.js +++ b/commands/config.js @@ -99,7 +99,7 @@ module.exports = { }, { name: "set_channel", - description: "Set one of the desired channels", + description: "Configure a channel", value: "set_channel", type: CommandOptions.SubCommand, options:[ @@ -126,7 +126,7 @@ module.exports = { }, { name: "linked_gt_role", - description: "Access Role to give to users", + description: "Role for users with linked gamertags", value: "linked_gt_role", type: CommandOptions.SubCommand, options: [{ @@ -139,7 +139,7 @@ module.exports = { }, { name: "member_role", - description: "Role to give users when they join.", + description: "Role for users who join the server", value: "member_role", type: CommandOptions.SubCommand, options: [{ @@ -158,7 +158,7 @@ module.exports = { options: [ { name: "action", - description: "Add or remove a role from the exclude list.", + description: "Set or remove a role to be a bot administrator", value: "action", type: CommandOptions.String, choices: [ @@ -177,7 +177,7 @@ module.exports = { }, { name: "admin_role", - description: "Discord Server's dedicated admin role", + description: "Admin role to ping in admin logs channel", value: "admin_role", type: CommandOptions.SubCommand, options: [{ @@ -190,7 +190,7 @@ module.exports = { }, { name: "exclude", - description: "Exclude roles from users to use to claim a flag.", + description: "Exclude roles that users can use to claim an armband", value: "exclude", type: CommandOptions.SubCommand, options: [ @@ -227,7 +227,7 @@ module.exports = { }, { name: "starting_balance", - description: "Set the starting balance", + description: "Set the starting balance of a new user", value: "starting_balance", type: CommandOptions.SubCommand, options: [{ @@ -235,7 +235,7 @@ module.exports = { description: "The amount to set the starting balance", value: "amount", type: CommandOptions.Float, - min_value: 0.01, + min_value: 1.00, required: true, }] }, @@ -269,7 +269,7 @@ module.exports = { }, { name: "income_role", - description: "Add/update a role to earn income on /collect-income command", + description: "Set/remove roles to recieve income", value: "set_income_role", type: CommandOptions.SubCommandGroup, options: [ @@ -313,7 +313,7 @@ module.exports = { }, { name: "income_limiter", - description: "Change the number of hours to wait before collecting income", + description: "Change the number of hours to wait before collecting next income", value: "income_limiter", type: CommandOptions.SubCommand, options: [{ @@ -321,12 +321,13 @@ module.exports = { description: "Number of hours till income can be collected", value: 168.00, // 1 week type: CommandOptions.Float, + min_value: 1.00, required: true, }] }, { name: "combat-log-timer", - description: "Adjust log timeout for combat prevention. (0 disables combat log)", + description: "Adjust number of minutes to detect combat logs (0 disables combat log)", value: "combat-log-timer", type: CommandOptions.SubCommand, options: [{ diff --git a/commands/debug.js b/commands/debug.js index 3e0eb9e..58c53d5 100644 --- a/commands/debug.js +++ b/commands/debug.js @@ -16,11 +16,6 @@ module.exports = { description: 'download the Nitrado logs and run checks now', value: 'sync-logs', type: CommandOptions.SubCommand, - }, { - name: 'server-connection-stats', - description: 'view player connection stats', - value: 'server-connection-stats', - type: CommandOptions.SubCommand, }], SlashCommand: { /** @@ -38,32 +33,6 @@ module.exports = { interaction.send({ content: 'Downloading and processing Nitrado logs now...', flags: (1 << 6) }); return client.logsUpdateTimer(client); } - - if (args[0].name == 'server-connection-stats') { - let statsEmbed = new EmbedBuilder() - .setColor(client.config.Colors.Default) - .setTitle(`Server connection stats`); - - statsEmbed.addFields({ name: 'All time Unique connections', value: `> ${stats.length}`, inline: false }); - - let month3 = new Date().setMonth(new Date().getMonth() - 3); - let month3Players = await client.dbo.collection("players").find({"lastConnectDate": {$gt: month3}}); - statsEmbed.addFields({ name: 'Unique connections in the last 3 months', value: `> ${month3Players.length}`, inline: false }); - - let month = new Date().setMonth(new Date().getMonth() - 1); - let monthlyPlayers = await client.dbo.collection("players").find({"lastConnectDate": {$gt: month}}); - statsEmbed.addFields({ name: 'Unique connections in the last month', value: `> ${monthlyPlayers.length}`, inline: false }); - - let week = new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000) - let weeklyPlayers = await client.dbo.collection("players").find({"lastConnectDate": {$gt: week}}); - statsEmbed.addFields({ name: 'Unique connections in the last week', value: `> ${weeklyPlayers.length}`, inline: false }); - - let today = new Date(new Date().getTime() - 1 * 24 * 60 * 60 * 1000) - let dailyPlayers = await client.dbo.collection("players").find({"lastConnectDate": {$gt: today}}); - statsEmbed.addFields({ name: 'Unique connections in the last 24 hours', value: `> ${dailyPlayers.length}`, inline: false }); - - return interaction.send({ embeds: [statsEmbed] }); - } }, }, Interactions: {} diff --git a/commands/event.js b/commands/event.js index 386256d..ca946f6 100644 --- a/commands/event.js +++ b/commands/event.js @@ -14,7 +14,7 @@ module.exports = { }, options: [{ name: "player-track", - description: "track a player and announce location", + description: "Track a player and announce location", value: "player-track", type: CommandOptions.SubCommand, options: [{ @@ -26,7 +26,7 @@ module.exports = { }, { name: "time", - description: "duration of tracking", + description: "Duration of tracking", value: "time", type: CommandOptions.Integer, required: true, @@ -37,14 +37,14 @@ module.exports = { }, { name: "event-name", - description: "name of the event", + description: "Name of the event", value: "event-name", type: CommandOptions.String, required: true, }, { name: "channel", - description: "channel to host event", + description: "Channel to post tracking data", value: "channel", type: CommandOptions.Channel, channel_types: [0], // Restrict to text channel @@ -58,7 +58,7 @@ module.exports = { }] }, { name: "delete", - description: "delete an active event", + description: "Delete an active event", value: "delete", type: CommandOptions.SubCommand }], diff --git a/commands/help.js b/commands/help.js index b57ffd8..3e5fe7d 100644 --- a/commands/help.js +++ b/commands/help.js @@ -27,13 +27,13 @@ module.exports = { }, { name: "support", - description: "Get support for Applicatz", + description: "Get support for Application", value: "support", type: CommandOptions.SubCommand, }, { name: "credits", - description: "DayZR Bot Credits", + description: "DayZ.R Bot Credits", value: "credits", type: CommandOptions.SubCommand, }, @@ -111,9 +111,9 @@ module.exports = { } else if (args[0].name == 'support') { const supportEmbed = new EmbedBuilder() .setColor(client.config.Colors.Default) - .setDescription(`**__DayZR Bot Support__** + .setDescription(`**__DayZ.R Bot Support__** - Are you experiencing troubles with the DayZR Bot? + Are you experiencing troubles with the DayZ.R Bot? Do you have questions or concerns? Do you require help to use the bot? Do you have a feature you'd like to see? @@ -129,7 +129,8 @@ module.exports = { .setColor(client.config.Colors.Default) .setTitle('DayzRBot Credits') .setDescription(` - **Bot Author:** McDazzzled#5307 + **Bot Author:** mcdazzzled + **Github:** https://github.com/SowinskiBraeden/dayz-reforger ${client.config.SupportServer} `); @@ -139,16 +140,17 @@ module.exports = { const end = new Date().getTime(); const stats = new EmbedBuilder() .setColor(client.config.Colors.Default) - .setTitle('DayzRBot Statistics') + .setTitle('DayZ Reforger Bot Statistics') .addFields( { name: 'Guilds', value: `${client.guilds.cache.size}`, inline: true }, { name: 'Users', value: `${client.users.cache.size}`, inline: true }, { name: 'Latency', value: `${end - start}ms`, inline: true }, { name: 'Uptime', value: `${client.secondsToDhms(process.uptime().toFixed(2))}`, inline: true }, { name: 'Bot Version', value: `${client.config.Dev} v${client.config.Version}`, inline: true }, - { name: 'Discord Version', value: 'Discord.js v^14.8.0', inline: true }, - ) - + { name: 'Discord Version', value: `Discord.js ${package.dependencies["discord.js"]}`, inline: true }, + { name: 'MongoDB Version', value: `MongoDB ${package.dependencies.mongodb}`, inline: true}, + ); + return interaction.send({ embeds: [stats] }) } }, diff --git a/commands/leaderboard.js b/commands/leaderboard.js index ad0de86..479bf87 100644 --- a/commands/leaderboard.js +++ b/commands/leaderboard.js @@ -5,7 +5,7 @@ module.exports = { name: "leaderboard", debug: false, global: false, - description: "View server statistics leaderboard", + description: "View server stats leaderboard", usage: "[category] [limit]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], @@ -36,7 +36,7 @@ module.exports = { ] }, { name: "limit", - description: "leaderboard limit", + description: "Leaderboard limit", value: "limit", type: CommandOptions.Integer, min_value: 1, diff --git a/commands/lookup.js b/commands/lookup.js index 9bde3be..7368552 100644 --- a/commands/lookup.js +++ b/commands/lookup.js @@ -5,7 +5,7 @@ module.exports = { name: "lookup", debug: false, global: false, - description: "Search for a users discord or gamertag", + description: "Search for a user's Discord or Gamertag", usage: "[option] [parameter]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], diff --git a/commands/ping.js b/commands/ping.js deleted file mode 100644 index 33e676a..0000000 --- a/commands/ping.js +++ /dev/null @@ -1,31 +0,0 @@ -const { EmbedBuilder } = require('discord.js'); - -module.exports = { - name: "ping", - debug: true, - global: true, - description: "Test bot activity", - usage: "", - permissions: { - channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], - member: [], - }, - options: [], - SlashCommand: { - /** - * - * @param {require("../structures/DayzRBot")} client - * @param {import("discord.js").Message} message - * @param {string[]} args - * @param {*} param3 - */ - run: async (client, interaction, args, { GuildDB }, start) => { - const end = new Date().getTime(); - const pingEmbed = new EmbedBuilder() - .setDescription(`🏓 **Pong!** Bot ping: ${end - start}ms`) - .setColor(client.config.Colors.Default); - - return interaction.send({ embeds: [pingEmbed] }); - }, - }, -} \ No newline at end of file diff --git a/commands/purchase-uav.js b/commands/purchase-uav.js index 335f6a5..afc7c37 100644 --- a/commands/purchase-uav.js +++ b/commands/purchase-uav.js @@ -6,7 +6,7 @@ module.exports = { name: "purchase-uav", debug: false, global: false, - description: "Send a UAV to scout for 30 minutes. (500m range)", + description: "Send a UAV to scout for 30 minutes (500m range)", usage: "[x-coord] [y-coord]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], diff --git a/commands/reset.js b/commands/reset.js index b85e5c8..57b68ae 100644 --- a/commands/reset.js +++ b/commands/reset.js @@ -7,7 +7,7 @@ module.exports = { name: "reset", debug: false, global: false, - description: "Reset a users Banking data", + description: "Reset a user's bank/money", usage: "[user]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], diff --git a/commands/server.js b/commands/server.js index 53d27ca..6dd65c9 100644 --- a/commands/server.js +++ b/commands/server.js @@ -7,7 +7,7 @@ module.exports = { name: "server", debug: false, global: false, - description: "DayZ Server Administrative Commands", + description: "Nitrado DayZ Server Administrative Commands", usage: "[command] [options]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], @@ -46,7 +46,7 @@ module.exports = { type: CommandOptions.SubCommand, }, { name: "auto-restart", - description: "Enable/Disable periodic server checks and restart if stopped.", + description: "Enable/Disable periodic server checks and restart if stopped", value: "auto-restart", type: CommandOptions.SubCommand, }, { diff --git a/commands/stats.js b/commands/stats.js deleted file mode 100644 index a178bb7..0000000 --- a/commands/stats.js +++ /dev/null @@ -1,41 +0,0 @@ -const { EmbedBuilder } = require('discord.js'); -const fs = require('fs'); - -module.exports = { - name: "stats", - debug: true, - global: true, - description: "check bot statistics", - usage: "", - permissions: { - channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], - member: [], - }, - options: [], - SlashCommand: { - /** - * - * @param {require("../structures/DayzRBot")} client - * @param {import("discord.js").Message} message - * @param {string[]} args - * @param {*} param3 - */ - run: async (client, interaction, args, { GuildDB }, start) => { - const package = require('../package.json'); - - const end = new Date().getTime(); - const stats = new EmbedBuilder() - .setColor(client.config.Colors.Default) - .setTitle('DayZ Reforger Bot Statistics') - .addFields( - { name: 'Latency', value: `${end - start}ms`, inline: true }, - { name: 'Uptime', value: `${client.secondsToDhms(process.uptime().toFixed(2))}`, inline: true }, - { name: 'Bot Version', value: `${client.config.Dev} v${client.config.Version}`, inline: true }, - { name: 'Discord Version', value: `Discord.js ${package.dependencies["discord.js"]}`, inline: true }, - { name: 'MongoDB Version', value: `MongoDB ${package.dependencies.mongodb}`, inline: true}, - ) - - return interaction.send({ embeds: [stats] }) - }, - }, -} \ No newline at end of file diff --git a/commands/weapon-stats.js b/commands/weapon-stats.js index f6e603b..f83e3b6 100644 --- a/commands/weapon-stats.js +++ b/commands/weapon-stats.js @@ -7,7 +7,7 @@ module.exports = { name: "weapon-stats", debug: false, global: false, - description: "Check player statistics", + description: "Check player weapon statistics", usage: "[category] [user or gamertag]", permissions: { channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], @@ -15,7 +15,7 @@ module.exports = { }, options: [{ name: "category", - description: "Weapon Category", + description: "Weapon category", value: "category", type: CommandOptions.String, required: true, @@ -34,13 +34,13 @@ module.exports = { ] }, { name: "discord", - description: "discord user to lookup stats", + description: "Discord user to lookup stats", value: "discord", type: CommandOptions.User, required: false, }, { name: "gamertag", - description: "gamertag to lookup stats", + description: "Gamertag to lookup stats", type: CommandOptions.String, required: false, }], diff --git a/package.json b/package.json index 19624b0..bbe13bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "12.5.12", + "version": "12.5.13", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": {