mirror of
https://gitlab.com/akasroua/covot
synced 2025-12-24 16:11:55 +01:00
Replace session files with string session
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1 @@
|
||||
src/constants.py
|
||||
*.session
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
from telethon import TelegramClient, events
|
||||
from constants import API_ID, API_HASH, BOT_TOKEN
|
||||
from telethon.sessions import StringSession
|
||||
from constants import API_ID, API_HASH, BOT_TOKEN, SESSION
|
||||
|
||||
bot = TelegramClient("bot", API_ID, API_HASH).start(bot_token=BOT_TOKEN)
|
||||
bot = TelegramClient(StringSession(SESSION), API_ID, API_HASH).start(
|
||||
bot_token=BOT_TOKEN
|
||||
)
|
||||
|
||||
|
||||
@bot.on(events.NewMessage(pattern="/start"))
|
||||
|
||||
Reference in New Issue
Block a user