mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2024-11-22 19:24:53 +08:00
[[[release 0.5.1.1]]]
## 🧯Bug Fix
- 修复误将 /o 命令写为 /on 命令的问题
- 使 Morny 在更新命令表时会先执行一遍命令表删除
This commit is contained in:
commit
864800122e
@ -1,6 +1,6 @@
|
|||||||
## Core
|
## Core
|
||||||
|
|
||||||
VERSION = 0.5.0.6
|
VERSION = 0.5.1.1
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
|
|
||||||
|
@ -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.5.0.6";
|
public static final String VERSION = "0.5.1.1";
|
||||||
public static final long COMPILE_TIMESTAMP = 1644378359640L;
|
public static final long COMPILE_TIMESTAMP = 1644381533694L;
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,7 @@ public class MornyCoeur {
|
|||||||
TrackerDataManager.DAEMON.interrupt();
|
TrackerDataManager.DAEMON.interrupt();
|
||||||
TrackerDataManager.trackingLock.lock();
|
TrackerDataManager.trackingLock.lock();
|
||||||
if (isRemoveCommandListWhenExit) {
|
if (isRemoveCommandListWhenExit) {
|
||||||
extra().exec(new DeleteMyCommands());
|
commandManager.automaticRemoveList();
|
||||||
logger.info("cleaned up command list.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import cc.sukazyo.cono.morny.data.TelegramStickers;
|
|||||||
import cc.sukazyo.untitled.telegram.api.formatting.TGToString;
|
import cc.sukazyo.untitled.telegram.api.formatting.TGToString;
|
||||||
import cc.sukazyo.untitled.util.telegram.object.InputCommand;
|
import cc.sukazyo.untitled.util.telegram.object.InputCommand;
|
||||||
import com.pengrad.telegrambot.model.BotCommand;
|
import com.pengrad.telegrambot.model.BotCommand;
|
||||||
|
import com.pengrad.telegrambot.model.DeleteMyCommands;
|
||||||
import com.pengrad.telegrambot.model.Update;
|
import com.pengrad.telegrambot.model.Update;
|
||||||
import com.pengrad.telegrambot.model.request.ParseMode;
|
import com.pengrad.telegrambot.model.request.ParseMode;
|
||||||
import com.pengrad.telegrambot.request.SendMessage;
|
import com.pengrad.telegrambot.request.SendMessage;
|
||||||
@ -90,12 +91,18 @@ public class MornyCommands {
|
|||||||
|
|
||||||
public void automaticUpdateList () {
|
public void automaticUpdateList () {
|
||||||
BotCommand[] commandList = getCommandListTelegram();
|
BotCommand[] commandList = getCommandListTelegram();
|
||||||
|
automaticRemoveList();
|
||||||
MornyCoeur.extra().exec(new SetMyCommands(
|
MornyCoeur.extra().exec(new SetMyCommands(
|
||||||
commandList
|
commandList
|
||||||
));
|
));
|
||||||
logger.info("automatic updated telegram command list :\n" + commandListToString(commandList));
|
logger.info("automatic updated telegram command list :\n" + commandListToString(commandList));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void automaticRemoveList () {
|
||||||
|
MornyCoeur.extra().exec(new DeleteMyCommands());
|
||||||
|
logger.info("cleaned up command list.");
|
||||||
|
}
|
||||||
|
|
||||||
private String commandListToString (@Nonnull BotCommand[] list) {
|
private String commandListToString (@Nonnull BotCommand[] list) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
for (BotCommand signal : list) {
|
for (BotCommand signal : list) {
|
||||||
@ -143,7 +150,7 @@ public class MornyCommands {
|
|||||||
///
|
///
|
||||||
|
|
||||||
private static class ON implements ITelegramCommand {
|
private static class ON implements ITelegramCommand {
|
||||||
@Nonnull @Override public String getName () { return "/on"; }
|
@Nonnull @Override public String getName () { return "/o"; }
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override public String[] getAliases () { return null; }
|
@Override public String[] getAliases () { return null; }
|
||||||
@Nonnull @Override public String getParamRule () { return ""; }
|
@Nonnull @Override public String getParamRule () { return ""; }
|
||||||
|
Loading…
Reference in New Issue
Block a user