proton
Proton
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.
Installation
-
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
Usage
Check the example directory for a simple userbot example.
Authenticating
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
Contributing
- 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
Contributors
- Chris Watson - creator and maintainer
Repository
proton
Owner
Statistic
- 11
- 3
- 0
- 0
- 3
- almost 3 years ago
- October 31, 2019
License
MIT License
Links
Synced at
Mon, 18 Nov 2024 03:24:32 GMT
Languages