修复上一个提交的一个 typo bug

This commit is contained in:
A.C.Sukazyo Eyre 2022-04-02 17:12:04 +08:00
parent 6dfaade55c
commit 9f9b9fbfa5
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
## Core
VERSION = 0.7.0.3
VERSION = 0.7.0.4
# 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.3";
public static final long COMPILE_TIMESTAMP = 1648803402848L;
public static final String VERSION = "0.7.0.4";
public static final long COMPILE_TIMESTAMP = 1648890683777L;
}

View File

@ -10,6 +10,8 @@ import com.pengrad.telegrambot.request.GetChatMember;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static cc.sukazyo.cono.morny.Log.logger;
public class DirectMsgClear implements ISimpleCommand {
@Nonnull @Override public String getName () { return "/r"; }
@ -19,11 +21,15 @@ public class DirectMsgClear implements ISimpleCommand {
@Override
public void execute (@Nonnull InputCommand command, @Nonnull Update event) {
logger.debug("Executing command /r");
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().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 (
isTrusted || (
@ -45,7 +51,7 @@ public class DirectMsgClear implements ISimpleCommand {
));
}
}
} else logger.trace("User is not trusted");
}