-
Notifications
You must be signed in to change notification settings - Fork 60
Configuration
The default option (production
) uses Webhook mode, you can set to development
to use polling mode.
API token of your bot, can be obtained from @BotFather.
Webhook URL to be set for Telegram server, must end with /
. e.g.: https://xxx.herokuapp.com/
Webhook port, automatically set if on Heroku.
Storage directory, can be local or remote, will be created if not exists.
Default: Pictures
Notice: You need to add your bot to channel administrators
Telegram channel ID used for storing messages, messages sent to bot and containing URL entities will be forwarded here for reviewing.
Telegram user ID(not username) of the admin, some bot functions are restricted to admin user.
eg:
export ADMIN_ID=111111
Whether to make this bot public, can be true
or false
.
Default: false
Added in v2
Telegram user ID of the allowed users other than admin, separated by a comma, ignored if IS_PUBLIC=true
.
e.g.:
export ALLOW_ID=12345
export ALLOW_USERNAME=12345,23456,34567
Changed in v2
Tips:
You can get your User ID & Channel ID via @GetIDs Bot
Telegram username of the allowed users other than admin, without @
prefix, separated by a comma, ignored if IS_PUBLIC=true
.
e.g.:
export ALLOW_USERNAME=user1
export ALLOW_USERNAME=user1,user2,user3
Changed in v2
Telegram group ID, separated by a comma. Users in this group will be able to use the bot in group chat.
e.g.:
export ALLOW_GROUP=-12345,-23456
Changed in v2
About access control:
- Allow all if
IS_PUBLIC=true
- User in
ALLOW_ID
orALLOW_USERNAME
orADMIN_ID
can access the bot via private chat- User in
ALLOW_GROUP
can access via specified group chatFor more information, see
nazurin/middleware.py
.
Caption items to ignore when generating image captions, separated by a comma.
e.g.:
export CAPTION_IGNORE=bookmarked
Default is none.
Added in v2
Type of database.
Supported databases:
Driver | Usage | Config | Note |
---|---|---|---|
TinyDB | https://github.com/y-young/nazurin/wiki/TinyDB | Local |
Default |
Firestore | https://github.com/y-young/nazurin/wiki/Firestore | Firebase |
|
MongoDB | https://github.com/y-young/nazurin/wiki/MongoDB | Mongo |
MongoDB Atlas supported |
Cloudant | https://github.com/y-young/nazurin/wiki/Cloudant | Cloudant |
You can also implement your own database driver by creating a file under database
folder, and set this option to the name of driver class.
A string list of storage names, separated by commas.
e.g.:
export STORAGE=Local,Telegram,Mega
Default: Local
Supported storage:
Name | Usage | Config | Note |
---|---|---|---|
Local | Append Local to STORAGE
|
Local |
Default |
Telegram | https://github.com/y-young/nazurin/wiki/Telegram | Telegram |
Added in v2 |
MEGA | https://github.com/y-young/nazurin/wiki/MEGA | Mega |
|
Google Drive | https://github.com/y-young/nazurin/wiki/Google-Drive | GoogleDrive |
|
OneDrive | https://github.com/y-young/nazurin/wiki/OneDrive | OneDrive |
Implement other storage by creating a file under storage
with a store
function.
Changed in v2