稍微修改 /runtime 命令的返回格式,添加 /start 打招呼支持

This commit is contained in:
A.C.Sukazyo Eyre 2022-05-19 15:14:18 +08:00
parent 9f9b9fbfa5
commit 16d74a3af5
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
3 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
## Core ## Core
VERSION = 0.7.0.4 VERSION = 0.7.0.5
# dependencies # dependencies

View File

@ -4,6 +4,6 @@ package cc.sukazyo.cono.morny;
* the final field that will be updated by gradle automatically. * the final field that will be updated by gradle automatically.
*/ */
public class GradleProjectConfigures { public class GradleProjectConfigures {
public static final String VERSION = "0.7.0.4"; public static final String VERSION = "0.7.0.5";
public static final long COMPILE_TIMESTAMP = 1648890683777L; public static final long COMPILE_TIMESTAMP = 1652944218716L;
} }

View File

@ -61,6 +61,7 @@ public class MornyCommands {
register( register(
new ON(), new ON(),
new Hello(), new Hello(),
new HelloOnStart(),
new GetUsernameAndId(), new GetUsernameAndId(),
new EventHack(), new EventHack(),
new Nbnhhsh(), new Nbnhhsh(),
@ -180,6 +181,7 @@ public class MornyCommands {
@Nonnull @Override public String getDescription () { return "打招呼"; } @Nonnull @Override public String getDescription () { return "打招呼"; }
@Override public void execute (@Nonnull InputCommand command, @Nonnull Update event) { onCommandHelloExec(event); } @Override public void execute (@Nonnull InputCommand command, @Nonnull Update event) { onCommandHelloExec(event); }
} }
private static class HelloOnStart implements ISimpleCommand { @Nonnull @Override public String getName () { return "/start"; }@Nullable @Override public String[] getAliases () { return new String[0]; }@Override public void execute (@Nonnull InputCommand command, @Nonnull Update event) { onCommandHelloExec(event); }}
private static void onCommandHelloExec (@Nonnull Update event) { private static void onCommandHelloExec (@Nonnull Update event) {
MornyCoeur.extra().exec(new SendSticker( MornyCoeur.extra().exec(new SendSticker(
event.message().chat().id(), event.message().chat().id(),
@ -265,12 +267,12 @@ public class MornyCommands {
- <code>%s</code> - <code>%s</code>
- <code>%s</code> - <code>%s</code>
- <code>%s</code> - <code>%s</code>
- <code>%d</code> cores
java runtime: java runtime:
- <code>%s</code> - <code>%s</code>
- <code>%s</code> - <code>%s</code>
vm memory: vm memory:
- <code>%d</code> / <code>%d</code> MB - <code>%d</code> / <code>%d</code> MB
- <code>%d</code> cores
coeur version: coeur version:
- <code>%s</code> - <code>%s</code>
- <code>%s</code> - <code>%s</code>
@ -283,15 +285,15 @@ public class MornyCommands {
- [<code>%d</code>]""", - [<code>%d</code>]""",
// system // system
escapeHtml(hostname), escapeHtml(hostname),
escapeHtml(System.getProperty("os.name")), escapeHtml(String.format("%s (%s)", System.getProperty("os.name"), System.getProperty("os.arch"))),
escapeHtml(System.getProperty("os.version")), escapeHtml(System.getProperty("os.version")),
Runtime.getRuntime().availableProcessors(),
// java // java
escapeHtml(System.getProperty("java.vm.name")), escapeHtml(System.getProperty("java.vm.vendor")+"."+System.getProperty("java.vm.name")),
escapeHtml(System.getProperty("java.version")), escapeHtml(System.getProperty("java.vm.version")),
// memory // memory
Runtime.getRuntime().totalMemory() / 1024 / 1024, Runtime.getRuntime().totalMemory() / 1024 / 1024,
Runtime.getRuntime().maxMemory() / 1024 / 1024, Runtime.getRuntime().maxMemory() / 1024 / 1024,
Runtime.getRuntime().availableProcessors(),
// version // version
escapeHtml(MornySystem.VERSION), escapeHtml(MornySystem.VERSION),
escapeHtml(MornySystem.getJarMd5()), escapeHtml(MornySystem.getJarMd5()),