package
Version:
v0.70.0
Opens a new window with list of versions in this module.
Published: Oct 13, 2022
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 20
Opens a new window with list of known importers.
README
¶
Examples
Most examples use environment variable client builders.
You can do it manually, see bot-auth-manual
for example.
- Obtain api_id and api_hash for your application and set as
APP_ID
, APP_HASH
- Set
SESSION_FILE
to something like ~/session.yourbot.json
for persistent auth
- Run example.
Please don't share APP_ID
or APP_HASH
, it can't be easily rotated.
Name |
Description |
Features |
auth |
User authentication from terminal input |
Custom UserAuthenticator |
bot-auth-manual |
Bot authentication |
session.Storage , setup without environment variables |
bot-echo |
Echo bot |
UpdateDispatcher, message sender |
bot-upload |
One-shot uploader for bot |
NoUpdates flag, uploads with MIME, custom file name and as audio, resolving peer by username, HTML message |
gif-download |
Saved gif backup (and restore) for user |
Download, upload, middlewares with rate limit, unpack |
bg-run |
Using client without Run |
contrib/bg package |
pretty-print |
Pretty-print requests, responses and updates |
The tgp package, middleware and custom UpdateHandler for all updates |
updates |
Updates engine example |
The updates package that recovers missed updates |
Environment variables
Name |
Description |
BOT_TOKEN |
Token from BotFather |
APP_ID |
api_id of Telegram app from my.telegram.org |
APP_HASH |
api_hash of Telegram app from my.telegram.org |
SESSION_FILE |
Path to session file, like /home/super-bot/.gotd/session.super-bot.json |
SESSION_DIR |
Path to session directory, if SESSION_FILE is not set, like /home/super-bot/.gotd |
Support
Still don't know how to use specific features? See user support.
Documentation
¶
Package examples contains usage examples for gotd features.
Run runs f callback with context and logger, panics on error.
Source Files
¶
Directories
¶
Binary auth implements authentication example for user using terminal.
|
Binary auth implements authentication example for user using terminal. |
|
|
Binary bot-auth-manual implements example of custom session storage and manually setting up client options without environment variables.
|
Binary bot-auth-manual implements example of custom session storage and manually setting up client options without environment variables. |
Binary bot-echo implements basic example for bot.
|
Binary bot-echo implements basic example for bot. |
Binary bot-upload implements upload example for bot.
|
Binary bot-upload implements upload example for bot. |
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.