forked from Teamabasof/kelimebot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
45 lines (35 loc) · 921 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from time import sleep
from pyrogram import Client
import logging
from dotenv import load_dotenv, set_key, unset_key
from os import getenv
load_dotenv('config.env')
# THE LOGGING
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logging.getLogger("pyrogram").setLevel(logging.WARNING)
LOGGER = logging.getLogger(__name__)
# Hesap
API_ID = getenv("API_ID")
API_HASH = getenv("API_HASH")
TOKEN = getenv("TOKEN")
USERNAME = getenv("USERNAME")
OWNER_ID = getenv("OWNER_ID", "")
if OWNER_ID and len(OWNER_ID) and OWNER_ID.isdigit():
OWNER_ID = int(OWNER_ID) # type: ignore
else:
OWNER_ID = None # type: ignore
# BOT CLIENTİ
bot = Client(
":memory:",
API_ID,
API_HASH,
bot_token=TOKEN,
plugins=dict(root="kelime_bot/plugins/"),
workers=16
)
# Oyun Verileri
oyun = {} # type: ignore
# rating
rating = {} # type: ignore