暂停斜线动作在 .DP7 相关群组运作 @Lapis-Apple

This commit is contained in:
A.C.Sukazyo Eyre 2022-01-21 14:53:32 +08:00
parent 07f111a6e7
commit 8f2c63e300
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
3 changed files with 18 additions and 3 deletions

View File

@ -1,6 +1,6 @@
## Core
VERSION = 0.4.3.5
VERSION = 0.4.3.6
# 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.4.3.5";
public static final long COMPILE_TIMESTAMP = 1642297552612L;
public static final String VERSION = "0.4.3.6";
public static final long COMPILE_TIMESTAMP = 1642747921571L;
}

View File

@ -12,6 +12,7 @@ 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 {
@ -21,6 +22,20 @@ public class OnUserSlashAction extends EventListener {
final String text = event.message().text();
if (text == null) return false;
// Due to @Lapis_Apple, we stopped slash action function at .DP7 groups.
// It may be enabled after some of 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 keyword \".DP7\".
- %s
- [%d]""",
event.message().chat().title(),
event.message().chat().id()
));
return false;
}
if (text.startsWith("/")) {
int prefixLength = 1;
boolean useVerbSuffix = true;