43 lines
974 B
Python
43 lines
974 B
Python
from asyncio import PriorityQueue
|
|
from telethon import TelegramClient
|
|
import logging
|
|
import sqlite3
|
|
import coloredlogs
|
|
from process_queue import *
|
|
|
|
coloredlogs.install(level='INFO')
|
|
|
|
api_id = YOUR TG API ID HERE
|
|
api_hash = YOUR TG API HASH HERE
|
|
|
|
temp_folder = TEMP FOLDER OF THE GENERATIONS
|
|
|
|
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
|
|
|
|
client.log_channel_id = ID OF LOG CHANNEL
|
|
client.main_channel_id = ID OF RAW CHANNEL
|
|
client.queue = PriorityQueue()
|
|
client.media_lock = asyncio.Lock()
|
|
client.process_queue = False
|
|
|
|
client.admin_id = USER ID OF THE ADMIN
|
|
|
|
workers = [
|
|
Worker('http://127.0.0.1:9000', client, 'armorlink'),
|
|
#Worker('http://127.0.0.1:9001', client, 'armorlink-low'),
|
|
#Worker('http://local.proxy:9000', client, 'g14')
|
|
]
|
|
|
|
log = logging.getLogger('bot')
|
|
|
|
|
|
|