Proton is a client library for Telegram. It uses tdlib as a backbone, and builds on top of it by adding several convenience classes and methods. The overarching goal is to have something as friendly as Telethon, with the tdlib bindings eventually being replaced by a pure Crystal alternative.
-
Clone tdlib from here, build it, and make sure it's installed and available in your library path. Typically this should be either
/usr/lib
or/usr/local/lib
. -
Add the dependency to your
shard.yml
:dependencies: proton: github: protoncr/proton branch: master
-
Run
shards install
-
Profit
Check the example directory for a simple userbot example.
require "proton"
class Userbot < Proton::Client
# Stuff
end
auth_flow = Proton::TerminalAuthFlow.new(encryption_key: "SOME_DB_ENCRYPTION_KEY")
userbot = Userbot.new(
api_id: 12345,
api_hash: "0123456789abcdef0123456789abcdef",
auth_flow: auth_flow,
verbosity_level: 0 # This is the tdlib verbosity
)
Userbot.start
- Fork it (https://github.com/protoncr/proton/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Chris Watson - creator and maintainer