public class KernelComm extends Object implements IKernelComm
| Constructor and Description |
|---|
KernelComm(int apiKey,
AbsApiState apiState) |
| Modifier and Type | Method and Description |
|---|---|
<T extends TLObject> |
doRpcCallAsync(TLMethod<T> method,
TelegramFunctionCallback<T> callback) |
void |
doRpcCallAsyncNoReturn(TLMethod<TLObject> method) |
<T extends TLObject> |
doRpcCallSync(TLMethod<T> method) |
<T extends TLObject> |
doRpcCallSyncNoAuth(TLMethod<T> method) |
protected void |
finalize() |
TelegramApi |
getApi() |
int |
getCurrentUserId() |
Downloader |
getDownloader() |
Uploader |
getUploader() |
boolean |
init() |
void |
onNotificationReceived(int notificationId,
Object... args) |
void |
performMarkAsRead(@NotNull IUser user,
int messageId) |
void |
performMarkGroupAsRead(@NotNull Chat group,
int messageId) |
void |
sendChannelMessage(@NotNull Chat channel,
@NotNull String message,
boolean asAdmin) |
void |
sendChannelMessageWithMarkdown(@NotNull Chat channel,
@NotNull String message,
boolean asAdmin) |
void |
sendChannelMessageWithoutPreview(@NotNull Chat channel,
@NotNull String message,
boolean asAdmin) |
void |
sendGroupMedia(@NotNull Chat chat,
@NotNull TLAbsInputMedia media) |
void |
sendGroupMessage(@NotNull Chat group,
@NotNull String message) |
void |
sendGroupMessageWithMarkdown(@NotNull Chat group,
@NotNull String message) |
void |
sendGroupMessageWithoutPreview(@NotNull Chat group,
@NotNull String message) |
void |
sendMedia(@NotNull IUser user,
@NotNull TLAbsInputMedia media) |
void |
sendMessage(@NotNull IUser user,
@NotNull String message) |
void |
sendMessage(@NotNull IUser user,
@NotNull String message,
@NotNull Boolean hasWebPreview) |
void |
sendMessageAsReply(@NotNull IUser user,
@NotNull String message,
@NotNull Integer replayToMsg) |
void |
sendMessageAsReplyAsync(@NotNull IUser user,
@NotNull String message,
@NotNull Integer replayToMsg,
TelegramFunctionCallback<TLAbsUpdates> callback)
Send a message as reply
|
void |
sendMessageAsync(@NotNull IUser user,
@NotNull String message,
@NotNull Boolean hasWebPreview,
@Nullable TelegramFunctionCallback<TLAbsUpdates> callback)
Send a message without web preview
|
void |
sendMessageAsync(@NotNull IUser user,
@NotNull String message,
TelegramFunctionCallback<TLAbsUpdates> callback)
Send a message
|
void |
sendMessageWithMarkdown(@NotNull IUser user,
@NotNull String message) |
void |
sendMessageWithoutPreview(@NotNull IUser user,
@NotNull String message) |
void |
sendMessageWithoutPreviewAsync(@NotNull IUser user,
@NotNull String message,
@Nullable TelegramFunctionCallback<TLAbsUpdates> callback)
Send a message without web preview
|
void |
sendUploadedGroupSticker(@NotNull String title,
@NotNull String mimetype,
@NotNull Chat group,
long idFile,
int parts) |
void |
sendUploadedSticker(@NotNull String title,
@NotNull String mimetype,
@NotNull IUser user,
long idFile,
int parts) |
void |
setMainHandler(@NotNull MainHandler mainHandler) |
public KernelComm(int apiKey,
AbsApiState apiState)
public void setMainHandler(@NotNull
@NotNull MainHandler mainHandler)
setMainHandler in interface IKernelCommpublic boolean init()
init in interface IKernelCommpublic <T extends TLObject> T doRpcCallSync(TLMethod<T> method) throws ExecutionException, RpcException
doRpcCallSync in interface IKernelCommExecutionExceptionRpcExceptionpublic <T extends TLObject> T doRpcCallSyncNoAuth(TLMethod<T> method) throws ExecutionException
doRpcCallSyncNoAuth in interface IKernelCommExecutionExceptionpublic <T extends TLObject> void doRpcCallAsync(TLMethod<T> method, TelegramFunctionCallback<T> callback)
doRpcCallAsync in interface IKernelCommpublic void doRpcCallAsyncNoReturn(TLMethod<TLObject> method)
doRpcCallAsyncNoReturn in interface IKernelCommpublic void sendMessage(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message)
throws RpcException
sendMessage in interface IKernelCommRpcExceptionpublic void sendMessage(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message,
@NotNull
@NotNull Boolean hasWebPreview)
throws RpcException
sendMessage in interface IKernelCommRpcExceptionpublic void sendMessageAsync(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message,
@NotNull
@NotNull Boolean hasWebPreview,
@Nullable
@Nullable TelegramFunctionCallback<TLAbsUpdates> callback)
sendMessageAsync in interface IKernelCommuser - Destination usermessage - Message to sendhasWebPreview - If the message must have web previewcallback - Callback to execute after sent. If no provided, a default one will be executed.public void sendMessageAsync(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message,
TelegramFunctionCallback<TLAbsUpdates> callback)
sendMessageAsync in interface IKernelCommuser - Destination usermessage - Message to sendcallback - Callback to execute after sent. If no provided, a default one will be executed.public void sendMessageAsReply(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message,
@NotNull
@NotNull Integer replayToMsg)
throws RpcException
sendMessageAsReply in interface IKernelCommRpcExceptionpublic void sendMessageAsReplyAsync(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message,
@NotNull
@NotNull Integer replayToMsg,
TelegramFunctionCallback<TLAbsUpdates> callback)
sendMessageAsReplyAsync in interface IKernelCommuser - Destination usermessage - Message to sendreplayToMsg - Id of the message to answercallback - Callback to execute after sent. If no provided, a default one will be executed.public void sendMessageWithMarkdown(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message)
throws RpcException
sendMessageWithMarkdown in interface IKernelCommRpcExceptionpublic void sendMessageWithoutPreview(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message)
throws RpcException
sendMessageWithoutPreview in interface IKernelCommRpcExceptionpublic void sendMessageWithoutPreviewAsync(@NotNull
@NotNull IUser user,
@NotNull
@NotNull String message,
@Nullable
@Nullable TelegramFunctionCallback<TLAbsUpdates> callback)
sendMessageWithoutPreviewAsync in interface IKernelCommuser - Destination usermessage - Message to sendcallback - Callback to execute after sent. If no provided, a default one will be executed.public void sendGroupMessage(@NotNull
@NotNull Chat group,
@NotNull
@NotNull String message)
throws RpcException
sendGroupMessage in interface IKernelCommRpcExceptionpublic void sendGroupMessageWithMarkdown(@NotNull
@NotNull Chat group,
@NotNull
@NotNull String message)
throws RpcException
sendGroupMessageWithMarkdown in interface IKernelCommRpcExceptionpublic void sendGroupMessageWithoutPreview(@NotNull
@NotNull Chat group,
@NotNull
@NotNull String message)
throws RpcException
sendGroupMessageWithoutPreview in interface IKernelCommRpcExceptionpublic void sendChannelMessage(@NotNull
@NotNull Chat channel,
@NotNull
@NotNull String message,
boolean asAdmin)
throws RpcException
sendChannelMessage in interface IKernelCommRpcExceptionpublic void sendChannelMessageWithMarkdown(@NotNull
@NotNull Chat channel,
@NotNull
@NotNull String message,
boolean asAdmin)
throws RpcException
sendChannelMessageWithMarkdown in interface IKernelCommRpcExceptionpublic void sendChannelMessageWithoutPreview(@NotNull
@NotNull Chat channel,
@NotNull
@NotNull String message,
boolean asAdmin)
throws RpcException
sendChannelMessageWithoutPreview in interface IKernelCommRpcExceptionpublic void sendMedia(@NotNull
@NotNull IUser user,
@NotNull
@NotNull TLAbsInputMedia media)
throws RpcException
sendMedia in interface IKernelCommRpcExceptionpublic void sendGroupMedia(@NotNull
@NotNull Chat chat,
@NotNull
@NotNull TLAbsInputMedia media)
throws RpcException
sendGroupMedia in interface IKernelCommRpcExceptionpublic void sendUploadedSticker(@NotNull
@NotNull String title,
@NotNull
@NotNull String mimetype,
@NotNull
@NotNull IUser user,
long idFile,
int parts)
throws RpcException
sendUploadedSticker in interface IKernelCommRpcExceptionpublic void sendUploadedGroupSticker(@NotNull
@NotNull String title,
@NotNull
@NotNull String mimetype,
@NotNull
@NotNull Chat group,
long idFile,
int parts)
throws RpcException
sendUploadedGroupSticker in interface IKernelCommRpcExceptionpublic void performMarkAsRead(@NotNull
@NotNull IUser user,
int messageId)
throws RpcException
performMarkAsRead in interface IKernelCommRpcExceptionpublic void performMarkGroupAsRead(@NotNull
@NotNull Chat group,
int messageId)
throws RpcException
performMarkGroupAsRead in interface IKernelCommRpcExceptionpublic int getCurrentUserId()
getCurrentUserId in interface IKernelCommpublic void onNotificationReceived(int notificationId,
Object... args)
onNotificationReceived in interface NotificationsService.NotificationObserverpublic Downloader getDownloader()
getDownloader in interface IKernelCommpublic Uploader getUploader()
getUploader in interface IKernelCommpublic TelegramApi getApi()
getApi in interface IKernelCommCopyright © 2016. All rights reserved.