mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 10:44:50 +00:00
Forget ctx and add mongo session for bot
This commit is contained in:
parent
5cf1761a21
commit
e03a0a6df2
2 changed files with 4 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ from pyrogram import Client
|
|||
|
||||
from database.session_db import MongoStorage
|
||||
from misskaty.core import misskaty_patch
|
||||
from misskaty.vars import API_HASH, API_ID, BOT_TOKEN, DATABASE_URI, TZ, USER_SESSION
|
||||
from misskaty.vars import API_HASH, API_ID, BOT_TOKEN, DATABASE_URI, TZ, USER_SESSION, DATABASE_NAME
|
||||
|
||||
basicConfig(
|
||||
level=INFO,
|
||||
|
|
@ -39,6 +39,7 @@ app = Client(
|
|||
api_id=API_ID,
|
||||
api_hash=API_HASH,
|
||||
bot_token=BOT_TOKEN,
|
||||
mongodb=dict(uri=DATABASE_URI, db_name=DATABASE_NAME, remove_peers=False),
|
||||
)
|
||||
|
||||
# Pyrogram UserBot Client
|
||||
|
|
@ -47,7 +48,7 @@ user = Client(
|
|||
session_string=USER_SESSION,
|
||||
)
|
||||
|
||||
jobstores = {"default": MongoDBJobStore(client=pymonclient, database="MissKatyDB", collection="nightmode")}
|
||||
jobstores = {"default": MongoDBJobStore(client=pymonclient, database=DATABASE_NAME, collection="nightmode")}
|
||||
scheduler = AsyncIOScheduler(jobstores=jobstores, timezone=TZ)
|
||||
|
||||
app.start()
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ async def donate(client, ctx):
|
|||
InlineButton('PayPal', url='https://paypal.me/yasirarism'),
|
||||
)
|
||||
await ctx.reply(
|
||||
f"Hai {message.from_user.mention}, jika kamu merasa bot ini besrguna bisa melakukan donasi dengan ke rekening diatas yaa. Karena server bot ini tidaklah gratis. Terimakasih..\n\nHi {message.from_user.mention}, if you feel this bot is useful, you can make a donation to the account above. Because this bot server is not free. Thank you..",
|
||||
f"Hai {ctx.from_user.mention}, jika kamu merasa bot ini besrguna bisa melakukan donasi dengan ke rekening diatas yaa. Karena server bot ini tidaklah gratis. Terimakasih..\n\nHi {message.from_user.mention}, if you feel this bot is useful, you can make a donation to the account above. Because this bot server is not free. Thank you..",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue