mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2024-11-22 19:24:53 +08:00
修复上一个提交的一个 typo bug
This commit is contained in:
parent
6dfaade55c
commit
9f9b9fbfa5
@ -1,6 +1,6 @@
|
|||||||
## Core
|
## Core
|
||||||
|
|
||||||
VERSION = 0.7.0.3
|
VERSION = 0.7.0.4
|
||||||
|
|
||||||
# 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.7.0.3";
|
public static final String VERSION = "0.7.0.4";
|
||||||
public static final long COMPILE_TIMESTAMP = 1648803402848L;
|
public static final long COMPILE_TIMESTAMP = 1648890683777L;
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ import com.pengrad.telegrambot.request.GetChatMember;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import static cc.sukazyo.cono.morny.Log.logger;
|
||||||
|
|
||||||
public class DirectMsgClear implements ISimpleCommand {
|
public class DirectMsgClear implements ISimpleCommand {
|
||||||
|
|
||||||
@Nonnull @Override public String getName () { return "/r"; }
|
@Nonnull @Override public String getName () { return "/r"; }
|
||||||
@ -19,11 +21,15 @@ public class DirectMsgClear implements ISimpleCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void execute (@Nonnull InputCommand command, @Nonnull Update event) {
|
public void execute (@Nonnull InputCommand command, @Nonnull Update event) {
|
||||||
|
|
||||||
|
logger.debug("Executing command /r");
|
||||||
if (event.message().replyToMessage() == null) return;
|
if (event.message().replyToMessage() == null) return;
|
||||||
|
logger.trace("Message is a reply");
|
||||||
if (event.message().replyToMessage().from().id() != MornyCoeur.getUserid()) return;
|
if (event.message().replyToMessage().from().id() != MornyCoeur.getUserid()) return;
|
||||||
if (event.message().replyToMessage().date() - System.currentTimeMillis()/1000 < 48*60*60) return;
|
logger.trace("Message is from me");
|
||||||
|
if (System.currentTimeMillis()/1000 - event.message().replyToMessage().date() > 48*60*60) return;
|
||||||
|
logger.trace("Message is not older than 48 hours");
|
||||||
|
|
||||||
final boolean isTrusted = MornyCoeur.trustedInstance().isTrusted(event.message().chat().id());
|
final boolean isTrusted = MornyCoeur.trustedInstance().isTrusted(event.message().from().id());
|
||||||
|
|
||||||
if (
|
if (
|
||||||
isTrusted || (
|
isTrusted || (
|
||||||
@ -45,7 +51,7 @@ public class DirectMsgClear implements ISimpleCommand {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else logger.trace("User is not trusted");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user