mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2024-11-22 11:14:55 +08:00
暂停斜线动作在 .DP7 相关群组运作 @Lapis-Apple
This commit is contained in:
parent
07f111a6e7
commit
8f2c63e300
@ -1,6 +1,6 @@
|
||||
## Core
|
||||
|
||||
VERSION = 0.4.3.5
|
||||
VERSION = 0.4.3.6
|
||||
|
||||
# dependencies
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user