From 0472b592f7b702e49c236104c8044abab23c845a Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 10 Sep 2023 00:31:23 +0200 Subject: [PATCH 1/3] Wording & consistency Update EzVzApplyPanelCommand.kt Update CreateSubmissionCommand.kt Made error messages more consistent Added some line breaks for easier reading once rendered And one more typography fix elsewhere --- .../command/implementations/AccelCommand.kt | 16 +++--- .../CreateSubmissionCommand.kt | 4 +- .../ezvz/commands/EzVzApplyPanelCommand.kt | 52 +++++++++++-------- 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/src/main/kotlin/org/vzbot/discordbot/command/implementations/AccelCommand.kt b/src/main/kotlin/org/vzbot/discordbot/command/implementations/AccelCommand.kt index 3e6e2a9..0f44e36 100644 --- a/src/main/kotlin/org/vzbot/discordbot/command/implementations/AccelCommand.kt +++ b/src/main/kotlin/org/vzbot/discordbot/command/implementations/AccelCommand.kt @@ -20,11 +20,11 @@ import kotlin.math.max import kotlin.math.round import kotlin.math.sqrt -private val cmd = Commands.slash("accel", "will calculate a acceleration diagram and display it") - .addOption(OptionType.NUMBER, "acceleration", "The acceleration of the movement in mm/s²", true) - .addOption(OptionType.NUMBER, "desired-speed", "The speed it should reach in mm/s", true) - .addOption(OptionType.NUMBER, "mass", "mass of the moving gantry im g", true) - .addOption(OptionType.NUMBER, "movement-length", "The size of the movement in mm", true) +private val cmd = Commands.slash("accel", "will calculate an acceleration diagram and display it") + .addOption(OptionType.NUMBER, "acceleration", "The acceleration of the movement, in mm/s²", true) + .addOption(OptionType.NUMBER, "desired-speed", "The desired movement speed, in mm/s", true) + .addOption(OptionType.NUMBER, "mass", "The mass of the moving gantry, in grams", true) + .addOption(OptionType.NUMBER, "movement-length", "The distance of the movement, in mm", true) class AccelCommand : Command("accel", cmd, false) { override fun execute(member: Member, event: SlashCommandInteractionEvent) { @@ -101,15 +101,15 @@ class AccelCommand : Command("accel", cmd, false) { embed.addField("Desired speed", "${givenSpeed}mm/s", true) embed.addField("Distance where speed is matched", "${round((maxDistance - minDistance) * 2)}mm", true) embed.addField( - "Amount of movement with desired speed covered", + "Movement distance with desired speed covered", "${round(((maxDistance - minDistance) * 2) / length * 100)}%", true, ) - embed.addField("Movement length", "${length}mm", true) + embed.addField("Movement distance", "${length}mm", true) val duration = timeToFullSpeed + (round((maxDistance - minDistance) * 2) / givenSpeed) + timeToFullSpeed embed.addField("Movement duration", "${round(duration * 1000) / 1000}s", true) embed.addField("Time to full speed", "${(timeToFullSpeed)}s", true) - embed.addField("Distance to move until full speed", "${round((distanceToFullSpeed))}mm", true) + embed.addField("Distance to move until reaching full speed", "${round((distanceToFullSpeed))}mm", true) embed.setImage("attachment://temp.png") event.replyEmbeds(embed.build()).addFiles(FileUpload.fromData(temp)).queue() temp.delete() diff --git a/src/main/kotlin/org/vzbot/discordbot/command/implementations/CreateSubmissionCommand.kt b/src/main/kotlin/org/vzbot/discordbot/command/implementations/CreateSubmissionCommand.kt index e1c49d3..3bb6c11 100644 --- a/src/main/kotlin/org/vzbot/discordbot/command/implementations/CreateSubmissionCommand.kt +++ b/src/main/kotlin/org/vzbot/discordbot/command/implementations/CreateSubmissionCommand.kt @@ -18,7 +18,7 @@ class CreateSubmissionCommand: Command("submit",dat , false) { if (submissionDAO.hasSubmission(member.idLong)) { val sub = submissionDAO.getSubmission(member.idLong) - event.replyEmbeds(defaultEmbed("You already have sent your submission- ID: ${sub.id}")).queue() + event.replyEmbeds(defaultEmbed("You have already sent in your submission with ID: ${sub.id}")).queue() return } @@ -45,4 +45,4 @@ class CreateSubmissionCommand: Command("submit",dat , false) { event.reply("Done").complete().deleteOriginal().queue() } -} \ No newline at end of file +} diff --git a/src/main/kotlin/org/vzbot/discordbot/ezvz/commands/EzVzApplyPanelCommand.kt b/src/main/kotlin/org/vzbot/discordbot/ezvz/commands/EzVzApplyPanelCommand.kt index fd4055d..8fb8b51 100644 --- a/src/main/kotlin/org/vzbot/discordbot/ezvz/commands/EzVzApplyPanelCommand.kt +++ b/src/main/kotlin/org/vzbot/discordbot/ezvz/commands/EzVzApplyPanelCommand.kt @@ -35,12 +35,12 @@ import java.util.concurrent.TimeUnit * @version 1.0 * @author Devin Fritz */ -@DCommand("sendapplypanel", "Creates a application panel for the ezvz in this channel") +@DCommand("sendapplypanel", "Creates an EzVz application panel (embed) in the current channel") class EzVzPanelCommand : DiscordCommand() { override fun execute(actionSender: ActionSender) { if (!actionSender.getMember().isModerator()) { - actionSender.respondText("You're lacking the permission to execute this command", userOnly = true) + actionSender.respondText("You lack the required permissions to perform this action." + "\n" + "(not a moderator)", userOnly = true) return } @@ -78,23 +78,22 @@ class ApplyButton(discordButton: DiscordButton = DiscordButton()) : } if (ApplicationDAO.hasApplied(actionSender.getMember().idLong)) { - actionSender.respondText("You have already applied to the program", userOnly = true) + actionSender.respondText("You have already applied to the EzVz program", userOnly = true) return } if (ApplicationDAO.hasBeenAccepted(actionSender.getMember().idLong)) { - actionSender.respondText("You are already in the program", userOnly = true) + actionSender.respondText("You are already a member of the EzVz program", userOnly = true) return } - val country = - ActionRow.of( - TextInput.create("country", "Country", TextInputStyle.SHORT) - .setPlaceholder("From which country are you?").build(), - ) + val country = ActionRow.of( + TextInput.create("country", "Country", TextInputStyle.SHORT) + .setPlaceholder("Which country are you located in?").build(), + ) val continent = ActionRow.of( TextInput.create("continent", "Continent", TextInputStyle.SHORT) - .setPlaceholder("From which continent are you").build(), + .setPlaceholder("Which continent are you located on?").build(), ) val printers = ActionRow.of( TextInput.create("printers", "Printers", TextInputStyle.SHORT) @@ -103,10 +102,10 @@ class ApplyButton(discordButton: DiscordButton = DiscordButton()) : val filaments = ActionRow.of( TextInput.create("filaments", "Filaments", TextInputStyle.SHORT) - .setPlaceholder("Whats filaments are you capable of printing?").build(), + .setPlaceholder("What filaments are you capable of printing?").build(), ) - val modal = DiscordModal("EzVz Application", { sender, _, values -> + val modal = DiscordModal("EzVz Provider Application", { sender, _, values -> run { val countryInput = values["country"]!!.asString val continentInput = values["continent"]!!.asString @@ -152,7 +151,7 @@ class ApplyButton(discordButton: DiscordButton = DiscordButton()) : sender.respondText( userOnly = true, - text = "Your application has been created in ${textChannel.asMention}", + text = "Your application has been submitted in ${textChannel.asMention}", ) val applicationInfoEmbed = EmbedBuilder(defaultEmbed("Information about this application")) @@ -167,8 +166,11 @@ class ApplyButton(discordButton: DiscordButton = DiscordButton()) : } val infoEmbed = defaultEmbed( - "Welcome to your application ${actionSender.getMember().asMention}." + - " Please follow the rules of the application here. To begin: Send pictures of all 6 Sides of the VzCube in here.", + "Welcome to your EzVz Provider application, ${actionSender.getMember().asMention}!" + + "\n\n" + + "Please follow the rules of the application here." + + "\n" + + "To start off, please send pictures of all 6 sides of the requested printed VzCube in here.", Color.YELLOW, "EzVz Application", ) @@ -192,7 +194,7 @@ class DeclineApplication( PermanentDiscordButton("ezvz_accept", discordButton) { override fun execute(actionSender: ActionSender, hook: Message) { if (!actionSender.getMember().isModerator()) { - actionSender.respondText("You're missing the permissions to do this.", userOnly = true) + actionSender.respondText("You lack the required permissions to perform this action." + "\n" + "(not a moderator)", userOnly = true) return } @@ -205,7 +207,7 @@ class DeclineApplication( val application = ApplicationDAO.getApplicationFromTextChannel(channelID) if (application.status != ApplicationStatus.PENDING) { - actionSender.respondText(userOnly = true, text = "This application has already been processed") + actionSender.respondText(userOnly = true, text = "This application has already been processed!") return } @@ -213,7 +215,7 @@ class DeclineApplication( val user = VzBot.discord.retrieveMemberById(applicantID).complete() if (user == null) { - actionSender.respondText("The user has left the server. This application will be deleted in 10 seconds") + actionSender.respondText("The user cannot be found or has left the server. This application will be deleted in 10 seconds") ApplicationDAO.remove(application) hook.channel.delete().queueAfter(10, TimeUnit.SECONDS) return @@ -224,7 +226,9 @@ class DeclineApplication( val declinedEmbed = defaultEmbed( - "Unfortunately your application has been declined ${user.asMention}. You can delete this channel by pressing the delete button below.", + "${user.asMention}," + "\n" + + "Unfortunately, your EzVz Providers Application was denied." + "\n" + + "You can delete this channel with the delete button below.", Color.RED, "Declined", ) @@ -245,7 +249,7 @@ class AcceptApplication( PermanentDiscordButton("ezvz_decline", discordButton) { override fun execute(actionSender: ActionSender, hook: Message) { if (!actionSender.getMember().isModerator()) { - actionSender.respondText("You're missing the permissions to do this.", userOnly = true) + actionSender.respondText("You lack the required permissions to perform this action." + "\n" + "(not a moderator)", userOnly = true) return } @@ -267,7 +271,7 @@ class AcceptApplication( val user = VzBot.discord.retrieveMemberById(applicantID).complete() if (user == null) { - actionSender.respondText("The user has left the server. This application will be deleted in 10 seconds") + actionSender.respondText("The user has left the server. This application will be closed in 10 seconds") ApplicationDAO.remove(application) hook.channel.delete().queueAfter(10, TimeUnit.SECONDS) return @@ -278,7 +282,9 @@ class AcceptApplication( val acceptedEmbed = defaultEmbed( - "Congratulation your application has been accepted ${user.asMention}. You are now able to see all the content belonging to the EzVz Program.", + "Congratulations, ${user.asMention}!" + "\n" + + "Your EzVz Providers Application has been accepted!" + "\n" + + "You can now access the EzVz Program. Click on an order channel to get started ", Color.GREEN, "Accepted", ) @@ -319,7 +325,7 @@ class DeleteApplication( return } - actionSender.respondText("This channel will delete itself in 10 seconds") + actionSender.respondText("This channel will be closed in 10 seconds") hook.channel.delete().queueAfter(10, TimeUnit.SECONDS) } } From b71bf8097f791b4347e9f16ff45b0ffefd259633 Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 10 Sep 2023 00:47:45 +0200 Subject: [PATCH 2/3] Update README.md Update readme to match current affairs Add docs link, and fix Discord widget --- README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 242a614..c43757c 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,25 @@ # Discord-VZBot -Our discord VZBot managing the serial ids. -This bots usage is mainly to manage our Discord org.vzbot.discordbot.vzbot.VzBot. -Its built around having custom rules for channels and managing our Serial IDS we gave out for custom VZBots. +This bot (mainly) manages several functions on the VzBoT Discord server: -In the future it will support a custom warn and punish system which is currently WIP. +* Applying for and granting VzBoT serial ID's +* EzVz orders and providers +* Some support features -![Join us on Discord](https://discordapp.com/api/guilds/829828765512106054/widget.png?style=banner2) +It's built around having custom rules for channels, to make management and permissions easier. +Plans for the future include implementing a custom warnings and punishments system, which is currently WIP. Time will tell whether this is still necessary. + +The bot contains some functionality and features previously used on the TronXY Discord server, which are now no longer used. These will be removed in the future in order to streamline the VzBot Discord bot. + +Read the VzBot documentation: [docs.vzbot.org](https://docs.vzbot.org/) +Join us on Discord: [discord.gg/vzbot](https://discord.gg/vzbot/) + +![Discord widget](https://discordapp.com/api/guilds/829828765512106054/widget.png?style=banner3) ![d83b489c-6b62-4fff-923e-577ffe9a15dd](https://user-images.githubusercontent.com/37383368/148010563-464f9006-6cf8-4430-93d2-a66cc4282bac.jpg) +This project is licensed as [Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/). +More info: [creativecommons.org/licenses/by-nc/4.0](https://creativecommons.org/licenses/by-nc/4.0/) -This project is licensed as ![image](https://user-images.githubusercontent.com/37383368/139769027-7267da5b-7f58-499d-96bc-e41d164a3aac.png) - -https://creativecommons.org/licenses/by-nc/4.0/ From 5ce54b66082df619ef78440b3bfa882ad23f6782 Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 15 Sep 2023 00:27:15 +0200 Subject: [PATCH 3/3] Last change to the Readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c43757c..0cb141f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Discord-VZBot +# Discord-VzBoT + +*A friendly and Vz Bot* This bot (mainly) manages several functions on the VzBoT Discord server: