2021-10-29 18:47:52 +00:00
|
|
|
import asyncio
|
|
|
|
from pytgcalls import idle
|
2021-11-02 13:16:31 +00:00
|
|
|
from driver.veez import call_py, bot, user
|
2021-10-29 18:47:52 +00:00
|
|
|
|
2021-11-02 13:16:31 +00:00
|
|
|
BOT_ID = 0
|
|
|
|
USERBOT_ID = 0
|
2021-10-29 18:47:52 +00:00
|
|
|
|
2021-11-02 11:49:47 +00:00
|
|
|
async def all_info(bot, user):
|
2021-11-02 13:16:31 +00:00
|
|
|
global BOT_ID, BOT_NAME, BOT_USERNAME
|
|
|
|
global USERBOT_ID, USERBOT_NAME, USERBOT_MENTION, USERBOT_USERNAME
|
2021-11-02 09:40:37 +00:00
|
|
|
getme = await bot.get_me()
|
2021-11-02 11:49:47 +00:00
|
|
|
getme1 = await user.get_me()
|
2021-11-02 08:36:57 +00:00
|
|
|
BOT_ID = getme.id
|
|
|
|
USERBOT_ID = getme1.id
|
2021-11-02 13:16:31 +00:00
|
|
|
if getme.last_name:
|
|
|
|
BOT_NAME = getme.first_name + " " + getme.last_name
|
|
|
|
else:
|
|
|
|
BOT_NAME = getme.first_name
|
|
|
|
BOT_USERNAME = getme.username
|
|
|
|
USERBOT_NAME = (
|
|
|
|
f"{getme1.first_name} {getme1.last_name}"
|
|
|
|
if getme1.last_name
|
|
|
|
else getme1.first_name
|
|
|
|
)
|
|
|
|
USERBOT_USERNAME = getme1.username
|
|
|
|
USERBOT_MENTION = getme1.mention
|
2021-11-02 08:36:57 +00:00
|
|
|
|
|
|
|
|
2021-10-29 18:47:52 +00:00
|
|
|
async def mulai_bot():
|
|
|
|
print("[INFO]: STARTING BOT CLIENT")
|
|
|
|
await bot.start()
|
|
|
|
print("[INFO]: STARTING PYTGCALLS CLIENT")
|
|
|
|
await call_py.start()
|
2021-11-02 08:36:57 +00:00
|
|
|
print("[INFO]: GENERATING CLIENT PROFILE")
|
2021-11-02 11:49:47 +00:00
|
|
|
await all_info(bot, user)
|
2021-10-29 18:47:52 +00:00
|
|
|
await idle()
|
|
|
|
print("[INFO]: STOPPING BOT")
|
|
|
|
await bot.stop()
|
|
|
|
|
|
|
|
|
2021-10-29 20:19:54 +00:00
|
|
|
loop = asyncio.get_event_loop()
|
2021-10-29 18:47:52 +00:00
|
|
|
loop.run_until_complete(mulai_bot())
|