From 0a9c6ff7c12ae29044cfab0602aa903a658b2e6b Mon Sep 17 00:00:00 2001 From: Maoyue <95519633+MagicTeaMC@users.noreply.github.com> Date: Sun, 27 Aug 2023 15:37:38 +0800 Subject: [PATCH] display bot version on about commnad --- .idea/misc.xml | 1 - .../com/jagrosh/jmusicbot/commands/general/AboutCommand.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 67e1e61..42e3abe 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/src/main/java/com/jagrosh/jmusicbot/commands/general/AboutCommand.java b/src/main/java/com/jagrosh/jmusicbot/commands/general/AboutCommand.java index 9df1b45..a127931 100644 --- a/src/main/java/com/jagrosh/jmusicbot/commands/general/AboutCommand.java +++ b/src/main/java/com/jagrosh/jmusicbot/commands/general/AboutCommand.java @@ -5,6 +5,7 @@ import com.jagrosh.jdautilities.commons.JDAUtilitiesInfo; import com.jagrosh.jdautilities.doc.standard.CommandInfo; import com.jagrosh.jdautilities.examples.doc.Author; +import com.jagrosh.jmusicbot.utils.OtherUtil; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDAInfo; @@ -65,7 +66,7 @@ protected void execute(CommandEvent event) { builder.setColor(event.isFromType(ChannelType.TEXT) ? event.getGuild().getSelfMember().getColor() : this.color); builder.setAuthor(event.getSelfUser().getName() + " 的資訊!", null, event.getSelfUser().getAvatarUrl()); String author = event.getJDA().getUserById(event.getClient().getOwnerId()) == null ? "<@" + event.getClient().getOwnerId() + ">" : event.getJDA().getUserById(event.getClient().getOwnerId()).getName(); - StringBuilder descr = (new StringBuilder()).append("你好! 我是 **").append(event.getSelfUser().getName()).append("**。 ").append(this.IS_AUTHOR ? "使用Java寫成" : "我的擁有者是").append(" **").append(author).append("** ,本機器人依賴於 [JDA Utilities](https://github.com/JDA-Applications/JDA-Utilities) (").append(JDAUtilitiesInfo.VERSION).append(") 以及 [JDA wrapper](https://github.com/discord-jda/JDA) (").append(JDAInfo.VERSION).append(")\n\n請輸入 `").append(event.getClient().getTextualPrefix()).append(event.getClient().getHelpWord()) + StringBuilder descr = (new StringBuilder()).append("你好! 我是 **").append(event.getSelfUser().getName()).append("** (v" + OtherUtil.getCurrentVersion() + ")。 ").append(this.IS_AUTHOR ? "使用Java寫成" : "我的擁有者是").append(" **").append(author).append("** ,本機器人依賴於 [JDA Utilities](https://github.com/JDA-Applications/JDA-Utilities) (").append(JDAUtilitiesInfo.VERSION).append(") 以及 [JDA wrapper](https://github.com/discord-jda/JDA) (").append(JDAInfo.VERSION).append(")\n\n請輸入 `").append(event.getClient().getTextualPrefix()).append(event.getClient().getHelpWord()) .append("` 來查看我的指令!").append("\n請 [`邀請`](" + this.oauthLink + ")"+ "我到你的伺服器!"); descr.append("\n").append(event.getClient().getSuccess().startsWith("<") ? REPLACEMENT_ICON : event.getClient().getSuccess()).append(" ");