@Test public void setChatPermissions() { for (boolean bool : new boolean[]{true, false}) { ChatPermissions setPerms = new ChatPermissions(); setPerms.canSendMessages(bool); setPerms.canSendMediaMessages(bool); setPerms.canSendPolls(bool); setPerms.canSendOtherMessages(bool); setPerms.canAddWebPagePreviews(bool); setPerms.canChangeInfo(bool); setPerms.canInviteUsers(bool); setPerms.canPinMessages(bool); BaseResponse response = bot.execute(new SetChatPermissions(groupId, setPerms)); assertTrue(response.isOk()); Chat chat = bot.execute(new GetChat(groupId)).chat(); ChatPermissions permissions = chat.permissions(); if (bool) { assertTrue(permissions.canSendMessages()); assertTrue(permissions.canSendMediaMessages()); assertTrue(permissions.canSendPolls()); assertTrue(permissions.canSendOtherMessages()); assertTrue(permissions.canAddWebPagePreviews()); assertTrue(permissions.canChangeInfo()); assertTrue(permissions.canInviteUsers()); assertTrue(permissions.canPinMessages()); } else { assertFalse(permissions.canSendMessages()); assertFalse(permissions.canSendMediaMessages()); assertFalse(permissions.canSendPolls()); assertFalse(permissions.canSendOtherMessages()); assertFalse(permissions.canAddWebPagePreviews()); assertFalse(permissions.canChangeInfo()); assertFalse(permissions.canInviteUsers()); assertFalse(permissions.canPinMessages()); } } }
public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } TelegramBot(String botToken);   TelegramBot(Builder builder); }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } TelegramBot(String botToken);   TelegramBot(Builder builder); R execute(BaseRequest<T, R> request); void execute(T request, Callback<T, R> callback); String getFullFilePath(File file); byte[] getFileContent(File file); void setUpdatesListener(UpdatesListener listener); void setUpdatesListener(UpdatesListener listener, GetUpdates request); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler, GetUpdates request); void removeGetUpdatesListener(); }
TelegramBot { public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); } TelegramBot(String botToken);   TelegramBot(Builder builder); R execute(BaseRequest<T, R> request); void execute(T request, Callback<T, R> callback); String getFullFilePath(File file); byte[] getFileContent(File file); void setUpdatesListener(UpdatesListener listener); void setUpdatesListener(UpdatesListener listener, GetUpdates request); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler); void setUpdatesListener(UpdatesListener listener, ExceptionHandler exceptionHandler, GetUpdates request); void removeGetUpdatesListener();  }