【发布时间】:2019-10-23 15:37:18
【问题描述】:
我正在为超级组开发一个机器人。 如何验证成员是否为管理员?
我的 lib:org.telegram 4.2 https://core.telegram.org/bots/api
我尝试使用 ChatMember、GetChatAdministrators 和 SendMessage 方法,但我不知道如何插入参数,因为它们不询问它们,但它们只有 .get 选项(空响应)。只有 GetChatAdministrators 允许 ChatID 使用 .set 方法,但它会报错
GetChatAdministrators getadmin = new GetChatAdministrators().setChatId(ChatIDSupergroup);
ArrayList<ChatMember> s = null;
try {
s = getadmin.deserializeResponse(null); //Unable to deserialize response
} catch (TelegramApiRequestException e) {
e.printStackTrace();
}
ChatMember member = new ChatMember(); //There are only get options
String status=member.getStatus(); //null
【问题讨论】:
标签: java telegram telegram-bot