Swiftpack.co - Package - Takanu/Pelican

Pelican 0.8

Telegram API Wrapper for Swift.

Hi, 2-3 people that somehow both like Telegram and Swift! This package gives you a complete set of tools for making bots. It's still a little rough and not everything has been finished, so be careful

If you’ve never heard of Telegram it’s an awesome non-profit, secure messaging service that offers a lot of great features, one of them being a free Bot API where you can make bots for all kinds of tasks, from helping schedule channel posts to operating your own online HTML5 games that are playable inside the app.

Pelican is a framework I've developed personally for my own Telegram games and has a lot of great features:

  • Pelican automates the handling and distribution of updates through a unique session system that you can customise for your own specific needs - no need to make your own.
  • It's multi-threaded by default, with thread-safe session update handling and quick APIs for delaying code and Telegram API calls.
  • Features modular, tree-based routing systems for more advanced and interchangeable update sorting.

The code has extensive API documentation to help you use it, and I will include up-to-date tests and demo code soon. If you have any questions, feel free to message me on GitHub or on Telegram @takanu.

If you're interested in creating games with Pelican, I've also made a great game framework called TrashBoat.

Github

link
Stars: 18
Help us keep the lights on

Dependencies

Used By

Total: 1

Releases

0.8.1 - Oct 14, 2018

  • Initial conversion to Swift 4.2
  • Fixed misleading "useWebPreview" argument in the sendMessage Sync and Async method to "disableWebPreview"

0.8.0 - Apr 18, 2018

The release seems stable enough to make a "proper" numbered version. Swift Package Manager also really doesn't like pointing at revisions or odd tag names so this was a necessary change for dependency management.

0.8-beta-6 - Apr 18, 2018

New SessionRequest Module

  • The "linked sessions" functionality has been removed for accessing other sessions inside sessions, replaced with the SessionRequest type.
  • You can delete, fetch and create new sessions using this, and it will allow you to create multiple sessions for a single Telegram ID.
  • SessionBuilder types now require a name to be defined, which can be used by SessionRequest to precisely locate the type of Session you want to fetch, delete or create.
  • The type previously called SessionRequest has been renamed to MethodRequest, which better expresses it's purpose.

Changes

  • SessionTag and Update now use String-based Telegram IDs to ensure flexibility.
  • All TelegramRequest and MethodRequest methods that request a chat or user ID now request it as a string to keep ID types uniform.
  • MethodRequest now has a asynchronous implementation of Telegram's Edit methods, and has fixed sync methods which return a boolean.
  • Most API types have been moved to structs where it made sense.
  • Begun implementation on a SynchronisedDictionary type, used internally to allow a dictionary to be edited and read by multiple threads without any race conditions or state issues. This and it's Array counterpart will be expanded upon and made public later so anyone can utilise them.
  • Added CustomStringConvertible conformance to Route, SessionTag, Update, TelegramRequest and TelegramResponse for better debugging. More types will receive this soon.

Warning

  • Please note that Moderator is currently dangerous to use as it has not been properly multi-threaded. The system will be replaced in 0.9 with something better, so it will not yet be fixed.

0.8-beta-5 - Mar 27, 2018

Fixes

  • Fixed some quick sticker-related build issues.

0.8-beta-4 - Mar 27, 2018

Additions

  • answerInlineQuery and answerCallbackQuery now have async versions.
  • Sticker-related methods have now been implemented, and have both sync and async versions.
  • New location argument when initialising an inlineQuery.
  • When specifying a file path for files to upload and send to Telegram, you can now specify a path outside the project directory using file:// as a suffix. This syntax will likely change in future versions.

Fixes

  • Added a default value for markup in sendMessage.
  • Updated access control properties for TelegramResponse.
  • Implemented "non-bundle" file fetches in CacheManager.
  • Fixed kickChatMember method name.