Kantek is a userbot written in Python using Telethon.
Kantek is mostly built to help with the Administration of chats and is the main source for SpamWat.ch. Because of that it checks every message your account receives for blacklisted items, this includes strings, domains, top level domains, files, images and telegram entities. This means that for every message your account receives Kantek might make multiple http requests an resolve multiple telegram entities. The latter might lead to large (6+ hours) Floodwaits from Telegram.
If you want to use Kantek without the administration part, simply remove the plugins/autobahn
folder to disable these features.
Python 3.8+ is required to run the bot. ArangoDB 3.5+ or Postgres is used to store data.
- Copy the example config file to
config.json
- Create a database and a user in postgres
- kantek uses migrant for migrations. Follow the installation instructions here.
- Copy the
example.Migrant.toml
toMigrant.toml
and fill out the details. - Run
migrant setup
- Run
migrant apply --all
After setting up the database:
- Put the Authentication data into the config file.
- Run bot.py
Get it from http://my.telegram.org/
Required | Type | Default |
---|---|---|
Yes | int | - |
Get it from http://my.telegram.org/
Required | Type | Default |
---|---|---|
Yes | str | - |
The database to use. Only postgres
is supported currently.
Required | Type | Default |
---|---|---|
No | str | postgres |
Required | Type | Default |
---|---|---|
No | str | kantek |
Required | Type | Default |
---|---|---|
No | str | kantek |
Required | Type | Default |
---|---|---|
Yes | str | - |
The IP the Database runs on. For ArangoDB the http is automatically added
Required | Type | Default |
---|---|---|
No | str | 127.0.0.1 |
Default depends on the DB type.
Postgres: 5432
Required | Type | Default |
---|---|---|
No | int | See description |
The bot token for the bot that logs into the log channel
Required | Type | Default |
---|---|---|
Yes | str | - |
The channel id for the log bot
Required | Type | Default |
---|---|---|
Yes | int | - |
The group where gban and fban commands are sent to
Required | Type | Default |
---|---|---|
No | int | - |
The prefix you want to use
Required | Type | Default |
---|---|---|
No | str | . |
A list of prefixes you want to use
Required | Type | Default |
---|---|---|
No | List[str] | ["."] |
Required | Type | Default |
---|---|---|
No | str | kantek-session |
Required | Type | Default |
---|---|---|
No | str | https://api.spamwat.ch |
Required | Type | Default |
---|---|---|
No | str | - |
Useful for local development. Disabled actually banning a user in groups and reporting messages when using gban.
Required | Type | Default |
---|---|---|
No | bool | False |
Command to be run when executing .kill
. For example systemctl stop kantek
or pm2 stop kantek
Required | Type | Default |
---|---|---|
No | str | - |
Used in .kantek and .update
Required | Type | Default |
---|---|---|
No | str | src.kv2.dev |