Gram is an executable that utilizes the Telegram Database Library & Bot API to make your life easier.
- Nix
- A .env file with the following fields:
- API_ID:
App api_id
field under My Telegram > App Configuration - API_HASH:
App api_hash
field under My Telegram > App Configuration - API_PHONE_NUMBER: This will be used for phone verification of Telegram API, enter in international format
- API_ID:
user@machine:~/src/gram$ nix-build
> [2 built, 0.0 MiB DL]
user@machine:~/src/gram$ nix-shell
> gram.cabal is up-to-date
[nix-shell:~/src/gram]$ gram -c <CHAT_ID>
Once gram starts running you'll receive a verification code on the Telegram app, insert that into /tmp/code
.
- Nixops (Install using
nix-env -i nixops
) - Have your DigitalOcean token in env variable: export DIGITAL_OCEAN_AUTH_TOKEN=<token>
$ nixops create nix/trivial.nix nix/trivial-digital-ocean.nix
$ nixops deploy
This will create a new Droplet in DigitalOcean & create the gram
as a systemd service.