telegram-bot-simple

Build Status

Hackage Stackage LTS Stackage Nightly

Easy to use library for building Telegram bots in Haskell.

LambdaConf 2018 workshop

This library was featured in a LambdaConf 2018 workshop. The supplementary materials for the workshop is available at https://github.com/fizruk/lambdaconf-2018-workshop.

Examples

See bot examples here: https://github.com/fizruk/telegram-bot-simple/tree/master/examples

Use cabal build -fexamples to build it. If you are building with stack then use stack build --flag telegram-bot-simple:examples.

Contributing

Contributions are welcome! Feel free to ping me on GitHub, file an issue or submit a PR :)

Nick

Changes

0.6.2

  • Fix decoding for VideoChatStarted (see #132);

0.6.1

  • Fix response parsing in UpdatingMessages (see #131);
  • Move from short polling to long polling (see #129);

0.6

  • Fix newlines unexpected removing in UpdateParser module (see #124);

  • Add WebHooks support (see #127);

  • Fix parse_mode encoding in sendPhoto, sendDocument, sendVideo and sendAnimation methods (see #123 and 5ee5289);

  • Make package complaint with Telegram Bot API 6.2 (breaking changes included) (see fab1aee):

    • Added createInvoiceLink method;
    • Added getCustomEmojiStickers method;
    • User extended with is_premium and added_to_attachment_menu;
    • Chat extended with has_restricted_voice_and_video_messages, join_to_send_messages, join_by_request;
    • MessageEntityType extended with custom_emoji; file_size field for Animation, Audio, Document, Video, VideoNote Voice, File changed from Int to Integer;
    • SticketSet modified: contains_masks is optional now and becoming a subject of further deprecation in a future, type added;
    • Added StickerSetType: could be regular, mask and custom_emoji.

0.5.2

  • Helpers from UpdateParser module fixed, commandWithBotName added (see #121);

0.5.1

  • Fix inconsistency around ParseMode (see #114);
  • Fix copyMessage method (see #116);
  • Add CI via GitHub Actions (see #119);
  • Fix GHC 9.0 compilation regression (see #120);

0.5

  • Add MarkdownV2 to ParseMode haddock suggestion (see #110);

  • Make package complaint with Telegram Bot API 6.0 (breaking changes included) (see #112):

    • WebAppInfo data type added. KeyboardButton, InlineKeyboardButton extended with web_app record.
    • SentWebAppMessage data type added. answerWebAppQuery method added.
    • MenuButton data type added. setChatMenuButton, getChatMenuButton methods added.
    • ChatAdministratorRights data type added. setMyDefaultAdministratorRights, getMyDefaultAdministratorRights methods added.
    • :warning: ChatMember records changed: can_manage_voice_chats renamed to can_manage_video_chat.
    • :warning: PromoteChatMemberRequest records changed: can_manage_voice_chats renamed to can_manage_video_chats.
    • :warning: Message records changed: voice_chat_scheduled, voice_chat_started, voice_chat_ended, and voice_chat_participants_invited renamed to video_chat_scheduled, video_chat_started, video_chat_ended, and video_chat_participants_invited correspondingly.

0.4.5

  • Fix UpdateId overflow exception (see #108);
  • Hide examples under flag examples (see #109);

0.4.4

  • Fix build on Windows (see #107);

0.4.3

  • Add support spoiler message type and protect_content field for various methods (see #103);

0.4.2

  • Fix GHC 9.0 compilation (see #102 );

0.4.1

  • Game improvements (see #99 );
  • Aeson >= 2.0 support (see #100 );

0.4

  • Add Payments methods (see #93);
  • Add Passport methods (see #90);
  • Resolve discrepancies with Bot API 5.5 (see #87, #88)
  • Make startPolling polymorphic (see #86);
  • Add Updating messages methods (see #85) ;
  • Add missing methods (see #83, #84);
  • Add GameBot (see #82, #95);
  • Allow return different types in BotM (see #79, #98);
  • Fix UserId integer overflow (see #78);
  • Upgrade EchoBot example with sticker replies (see #77);
  • Refactor file uploads (see #76);
  • Add Stickers methods (see #72, #73, #74 and #75);
  • Refactor FileInfo (see #71);
  • Add Game methods (see #70);
  • Fix MessageId integer overflow (see #69);
  • Add missing types (see #66, #81);

0.3.8

  • Fix notification disable mechanism in sendDocument function (see #54);
  • Implement getFile and sendPhoto API methods (see #49);

0.3.7

  • Add inline mode support (see #45);

0.3.6

  • Remove extra spaces, restore Tested-with (see #48);
  • Add support of ghc 9 (see #47);

0.3.5

  • Restore backward compatibility with older GHCs (see #40);

0.3.4

  • Fix cron job, restrict dependency on cron (see #38, #39);

0.3.3

  • Derive Hashable for MessageId (see #36);

0.3.2

  • Implement forwardMessage API method (see #35);
  • Add MarkdownV2 parse mode (see #33);

0.3.1

  • Implement sendDocument function support. (see #31);
  • Add Travis CI (see #32);
  • Add MonadFail instance for UpdateParser (see #27);

0.3.0

  • Add underline and strikethrough MessageEntityTypes (see #25);
  • Fix for Stack 15 (see #24);
  • Fix installation after breaking change in servant-0.16 (see #21);
  • Add phonenumber type (see #23);
  • Add cashtag message entity type (close #19) (see #20);
  • Feat/kick chat member (see #17);
  • Feat/delete message method (see #16);
  • Fix startBotAsync, add processActionsIndefinitely (see #12);
  • Add some badges to README (Hackage/Stackage/Travis) (see 11f13f3);
  • Remove temporary files/scripts from repo (see 6bc9f48);
  • Add info about LambdaConf 2018 workshop and contributing (see 1ba4d95);
  • Add Data.Monoid import to fix builds on GHC 8.2 (see c798001);

0.2.0

  • Major changes:

  • Minor changes:

    • Add getEnvToken helper (see ce7d1f7);
    • Add IsString instance for Telegram.Token (see f105bb9);
    • Print Servant errors when getUpdates fails (see bc7c5bb);
    • Split Telegram.Bot.Simple into several submodules (see 8ed2783);
    • Add withEffect helper in Telegram.Bot.Simple.Eff (see aebba52);
    • More Haddock documentation;
  • Fixes:

    • Resolve #7 (see #8);
    • Fix undefined in startBotAsync and add more documentation (see 7879066);
    • Fix inline buttons issue (see #10);