使 user 支持命令在无参时设置目标为调用者

This commit is contained in:
A.C.Sukazyo Eyre 2021-12-17 18:22:25 +08:00
parent ee30b0a0ff
commit 8dad0930bc
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD
3 changed files with 4 additions and 12 deletions

View File

@ -1,6 +1,6 @@
## Core
VERSION = 0.4.2.3
VERSION = 0.4.2.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.4.2.3";
public static final long COMPILE_TIMESTAMP = 1639543312227L;
public static final String VERSION = "0.4.2.4";
public static final long COMPILE_TIMESTAMP = 1639736122490L;
}

View File

@ -19,7 +19,7 @@ public class GetUsernameAndId {
"[Unavailable] Too much arguments."
).replyToMessageId(event.message().messageId())); return; }
long userId = 0;
long userId = event.message().from().id();
if ( event.message().replyToMessage()!= null) {
userId = event.message().replyToMessage().from().id();
@ -36,14 +36,6 @@ public class GetUsernameAndId {
}
}
if (userId == 0) {
MornyCoeur.getAccount().execute(new SendMessage(
event.message().chat().id(),
"[Unavailable] no userid given."
).replyToMessageId(event.message().messageId()));
return;
}
final GetChatMemberResponse response = MornyCoeur.getAccount().execute(
new GetChatMember(event.message().chat().id(), userId)
);