Class DefaultSender

java.lang.Object
org.telegram.abilitybots.api.sender.DefaultSender
All Implemented Interfaces:
MessageSender

public class DefaultSender extends Object implements MessageSender
The default implementation of the MessageSender. This serves as a proxy to the DefaultAbsSender methods.
Author:
Abbas Abou Daya
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addStickerToSet(org.telegram.telegrambots.meta.api.methods.stickers.AddStickerToSet addStickerToSet)
     
    createNewStickerSet(org.telegram.telegrambots.meta.api.methods.stickers.CreateNewStickerSet createNewStickerSet)
     
     
    downloadFile(org.telegram.telegrambots.meta.api.objects.File file)
     
    void
    downloadFileAsync(String path, org.telegram.telegrambots.meta.updateshandlers.DownloadFileCallback<String> callback)
     
    void
    downloadFileAsync(org.telegram.telegrambots.meta.api.objects.File file, org.telegram.telegrambots.meta.updateshandlers.DownloadFileCallback<org.telegram.telegrambots.meta.api.objects.File> callback)
     
    <T extends Serializable, Method extends org.telegram.telegrambots.meta.api.methods.BotApiMethod<T>>
    T
    execute(Method method)
     
    <T extends Serializable, Method extends org.telegram.telegrambots.meta.api.methods.BotApiMethod<T>, Callback extends org.telegram.telegrambots.meta.updateshandlers.SentCallback<T>>
    void
    executeAsync(Method method, Callback callback)
     
    org.telegram.telegrambots.meta.api.objects.User
     
    void
    getMeAsync(org.telegram.telegrambots.meta.updateshandlers.SentCallback<org.telegram.telegrambots.meta.api.objects.User> sentCallback)
     
    org.telegram.telegrambots.meta.api.objects.WebhookInfo
     
    void
    getWebhookInfoAsync(org.telegram.telegrambots.meta.updateshandlers.SentCallback<org.telegram.telegrambots.meta.api.objects.WebhookInfo> sentCallback)
     
    org.telegram.telegrambots.meta.api.objects.Message
    sendAudio(org.telegram.telegrambots.meta.api.methods.send.SendAudio sendAudio)
     
    org.telegram.telegrambots.meta.api.objects.Message
    sendDocument(org.telegram.telegrambots.meta.api.methods.send.SendDocument sendDocument)
     
    org.telegram.telegrambots.meta.api.objects.Message
    sendPhoto(org.telegram.telegrambots.meta.api.methods.send.SendPhoto sendPhoto)
     
    org.telegram.telegrambots.meta.api.objects.Message
    sendSticker(org.telegram.telegrambots.meta.api.methods.send.SendSticker sendSticker)
     
    org.telegram.telegrambots.meta.api.objects.Message
    sendVideo(org.telegram.telegrambots.meta.api.methods.send.SendVideo sendVideo)
     
    org.telegram.telegrambots.meta.api.objects.Message
    sendVideoNote(org.telegram.telegrambots.meta.api.methods.send.SendVideoNote sendVideoNote)
     
    org.telegram.telegrambots.meta.api.objects.Message
    sendVoice(org.telegram.telegrambots.meta.api.methods.send.SendVoice sendVoice)
     
    setChatPhoto(org.telegram.telegrambots.meta.api.methods.groupadministration.SetChatPhoto setChatPhoto)
     
    org.telegram.telegrambots.meta.api.objects.File
    uploadStickerFile(org.telegram.telegrambots.meta.api.methods.stickers.UploadStickerFile uploadStickerFile)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • executeAsync

      public <T extends Serializable, Method extends org.telegram.telegrambots.meta.api.methods.BotApiMethod<T>, Callback extends org.telegram.telegrambots.meta.updateshandlers.SentCallback<T>> void executeAsync(Method method, Callback callback) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      executeAsync in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • execute

      public <T extends Serializable, Method extends org.telegram.telegrambots.meta.api.methods.BotApiMethod<T>> T execute(Method method) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      execute in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • addStickerToSet

      public Boolean addStickerToSet(org.telegram.telegrambots.meta.api.methods.stickers.AddStickerToSet addStickerToSet) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      addStickerToSet in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • createNewStickerSet

      public Boolean createNewStickerSet(org.telegram.telegrambots.meta.api.methods.stickers.CreateNewStickerSet createNewStickerSet) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      createNewStickerSet in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • uploadStickerFile

      public org.telegram.telegrambots.meta.api.objects.File uploadStickerFile(org.telegram.telegrambots.meta.api.methods.stickers.UploadStickerFile uploadStickerFile) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      uploadStickerFile in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • setChatPhoto

      public Boolean setChatPhoto(org.telegram.telegrambots.meta.api.methods.groupadministration.SetChatPhoto setChatPhoto) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      setChatPhoto in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • downloadFile

      public File downloadFile(String path) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      downloadFile in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • downloadFileAsync

      public void downloadFileAsync(String path, org.telegram.telegrambots.meta.updateshandlers.DownloadFileCallback<String> callback) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      downloadFileAsync in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • downloadFile

      public File downloadFile(org.telegram.telegrambots.meta.api.objects.File file) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      downloadFile in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • downloadFileAsync

      public void downloadFileAsync(org.telegram.telegrambots.meta.api.objects.File file, org.telegram.telegrambots.meta.updateshandlers.DownloadFileCallback<org.telegram.telegrambots.meta.api.objects.File> callback) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      downloadFileAsync in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • getMe

      public org.telegram.telegrambots.meta.api.objects.User getMe() throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      getMe in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • getWebhookInfo

      public org.telegram.telegrambots.meta.api.objects.WebhookInfo getWebhookInfo() throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      getWebhookInfo in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • getMeAsync

      public void getMeAsync(org.telegram.telegrambots.meta.updateshandlers.SentCallback<org.telegram.telegrambots.meta.api.objects.User> sentCallback) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      getMeAsync in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • getWebhookInfoAsync

      public void getWebhookInfoAsync(org.telegram.telegrambots.meta.updateshandlers.SentCallback<org.telegram.telegrambots.meta.api.objects.WebhookInfo> sentCallback) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      getWebhookInfoAsync in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • sendDocument

      public org.telegram.telegrambots.meta.api.objects.Message sendDocument(org.telegram.telegrambots.meta.api.methods.send.SendDocument sendDocument) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      sendDocument in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • sendPhoto

      public org.telegram.telegrambots.meta.api.objects.Message sendPhoto(org.telegram.telegrambots.meta.api.methods.send.SendPhoto sendPhoto) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      sendPhoto in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • sendVideo

      public org.telegram.telegrambots.meta.api.objects.Message sendVideo(org.telegram.telegrambots.meta.api.methods.send.SendVideo sendVideo) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      sendVideo in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • sendSticker

      public org.telegram.telegrambots.meta.api.objects.Message sendSticker(org.telegram.telegrambots.meta.api.methods.send.SendSticker sendSticker) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      sendSticker in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • sendAudio

      public org.telegram.telegrambots.meta.api.objects.Message sendAudio(org.telegram.telegrambots.meta.api.methods.send.SendAudio sendAudio) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      sendAudio in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • sendVoice

      public org.telegram.telegrambots.meta.api.objects.Message sendVoice(org.telegram.telegrambots.meta.api.methods.send.SendVoice sendVoice) throws org.telegram.telegrambots.meta.exceptions.TelegramApiException
      Specified by:
      sendVoice in interface MessageSender
      Throws:
      org.telegram.telegrambots.meta.exceptions.TelegramApiException
    • sendVideoNote

      public org.telegram.telegrambots.meta.api.objects.Message sendVideoNote(org.telegram.telegrambots.meta.api.methods.send.SendVideoNote sendVideoNote)
      Specified by:
      sendVideoNote in interface MessageSender