forked from AI621/ai621
1
0
Fork 0
ai621111/config.example.py

52 lines
1.4 KiB
Python
Raw Normal View History

2023-07-04 18:19:03 +00:00
from asyncio import PriorityQueue
from telethon import TelegramClient
import logging
import sqlite3
import coloredlogs
from process_queue import *
coloredlogs.install(level='INFO')
# https://docs.telethon.dev/en/stable/basic/signing-in.html
api_id = <YOUR TG API ID HERE>
api_hash = <YOUR TG API HASH HERE>
# Get it from @BotFather bot.
bot_token = <YOUR BOT TOKEN HERE>
2023-07-04 18:19:03 +00:00
client = TelegramClient('bot', api_id, api_hash)
e621 = sqlite3.connect('e621.db')
e621.row_factory = sqlite3.Row
conn = sqlite3.connect('ai621.db', isolation_level=None)
conn.row_factory = sqlite3.Row
client.conn = conn
client.process = None
# To get channel ID: Send something in private(!) channel, tap/click on it,
# choose "Copy post link", paste it somewhere. It should look like this:
# https://t.me/c/12345/2
# 12345 part is ID - add "-100" prefix before it (like this: -10012345)
# Replace placeholder with result:
client.log_channel_id = <ID OF LOG CHANNEL>
client.main_channel_id = <ID OF RAW CHANNEL>
2023-07-04 18:19:03 +00:00
client.queue = PriorityQueue()
client.media_lock = asyncio.Lock()
client.process_queue = False
2023-08-15 22:05:22 +00:00
# Send message to @my_id_bot, it will reply with your Telegram ID.
client.admin_id = <USER ID OF THE ADMIN>
2023-07-04 18:19:03 +00:00
workers = [
Worker('http://127.0.0.1:7860', client, 'armorlink'),
2023-07-04 18:19:03 +00:00
#Worker('http://127.0.0.1:9001', client, 'armorlink-low'),
#Worker('http://local.proxy:9000', client, 'g14')
]
log = logging.getLogger('bot')