关闭 对DP7关闭SlashAction 功能,关闭 OnKuohuanhuanNeedSleep 系列功能

This commit is contained in:
A.C.Sukazyo Eyre 2022-05-28 21:36:36 +08:00
parent 88cc868c90
commit c4bdf2846b
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
4 changed files with 16 additions and 17 deletions

View File

@ -1,6 +1,6 @@
## Core
VERSION = 0.7.0.12
VERSION = 0.7.0.13
# dependencies

View File

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

View File

@ -11,7 +11,7 @@ public class EventListeners {
public static final OnInlineQueries INLINE_QUERY = new OnInlineQueries();
public static final OnCallMe CALL_ME = new OnCallMe();
public static final OnEventHackHandle EVENT_HACK_HANDLE = new OnEventHackHandle();
public static final OnKuohuanhuanNeedSleep KUOHUANHUAN_NEED_SLEEP = new OnKuohuanhuanNeedSleep();
@SuppressWarnings("unused") static final OnKuohuanhuanNeedSleep KUOHUANHUAN_NEED_SLEEP = new OnKuohuanhuanNeedSleep();
public static final OnUserRandoms USER_RANDOMS = new OnUserRandoms();
public static final OnCallMsgSend CALL_MSG_SEND = new OnCallMsgSend();
@ -19,7 +19,7 @@ public class EventListeners {
EventListenerManager.addListener(
ACTIVITY_RECORDER,
UPDATE_TIMESTAMP_OFFSET_LOCK,
KUOHUANHUAN_NEED_SLEEP,
// KUOHUANHUAN_NEED_SLEEP,
COMMANDS_LISTENER,
USER_RANDOMS,
USER_SLASH_ACTION,

View File

@ -3,7 +3,6 @@ package cc.sukazyo.cono.morny.bot.event;
import cc.sukazyo.cono.morny.MornyCoeur;
import cc.sukazyo.cono.morny.bot.api.EventListener;
import cc.sukazyo.cono.morny.util.tgapi.TGToStringFromMessage;
import cc.sukazyo.untitled.telegram.api.formatting.TGToString;
import cc.sukazyo.untitled.util.command.CommonCommand;
import cc.sukazyo.untitled.util.string.StringArrays;
@ -14,7 +13,6 @@ import com.pengrad.telegrambot.request.SendMessage;
import javax.annotation.Nonnull;
import static cc.sukazyo.cono.morny.Log.logger;
import static cc.sukazyo.untitled.util.telegram.formatting.MsgEscape.escapeHtml;
public class OnUserSlashAction extends EventListener {
@ -24,20 +22,21 @@ public class OnUserSlashAction extends EventListener {
final String text = event.message().text();
if (text == null) return false;
if (text.startsWith("/")) {
if (text.startsWith("/"))
{
/// Due to @Lapis_Apple, we stopped slash action function at .DP7 groups.
/// It may be enabled after some updates when the function will not be conflicted to other bots.
// if (event.message().chat().id() == ) return false;
if (event.message().chat().title() != null && event.message().chat().title().contains(".DP7")) {
logger.info(String.format("""
Chat slash action ignored due to the following keyword.
- %s
- ".DP7\"""",
TGToString.as(event.message().chat()).toStringFullNameId()
));
return false;
}
//{ if (event.message().chat().title() != null && event.message().chat().title().contains(".DP7")) {
// logger.info(String.format("""
// Chat slash action ignored due to the following keyword.
// - %s
// - ".DP7\"""",
// TGToString.as(event.message().chat()).toStringFullNameId()
// ));
// return false;
// }
final String[] action = CommonCommand.format(text);
action[0] = action[0].substring(1);