From 8dad0930bcb9035b639c1e602e52ee1dfb074030 Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Fri, 17 Dec 2021 18:22:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=20user=20=E6=94=AF=E6=8C=81=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=9C=A8=E6=97=A0=E5=8F=82=E6=97=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E4=B8=BA=E8=B0=83=E7=94=A8=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../cc/sukazyo/cono/morny/GradleProjectConfigures.java | 4 ++-- .../morny/bot/event/on_commands/GetUsernameAndId.java | 10 +--------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/gradle.properties b/gradle.properties index 50cbf59..2d2e5dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ ## Core -VERSION = 0.4.2.3 +VERSION = 0.4.2.4 # dependencies diff --git a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java index 8a50a22..3a8381d 100644 --- a/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java +++ b/src/main/java/cc/sukazyo/cono/morny/GradleProjectConfigures.java @@ -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; } diff --git a/src/main/java/cc/sukazyo/cono/morny/bot/event/on_commands/GetUsernameAndId.java b/src/main/java/cc/sukazyo/cono/morny/bot/event/on_commands/GetUsernameAndId.java index b54bb9d..18e91a0 100644 --- a/src/main/java/cc/sukazyo/cono/morny/bot/event/on_commands/GetUsernameAndId.java +++ b/src/main/java/cc/sukazyo/cono/morny/bot/event/on_commands/GetUsernameAndId.java @@ -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) );