Created
May 27, 2022 08:23
-
-
Save justxor/21be377c8eb96bb8a4956fb0ebfd1936 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from helper._get import * | |
LOGS.info("Starting...") | |
######## Connect ######## | |
try: | |
cbot = TelegramClient("bot", APP_ID, API_HASH).start(bot_token=BOT_TOKEN) | |
except Exception as e: | |
LOGS.info("Environment vars are missing! Kindly recheck.") | |
LOGS.info("Bot is quiting...") | |
LOGS.info(str(e)) | |
exit() | |
####### GENERAL CMDS ######## | |
@cbot.on(events.NewMessage(pattern="/start")) | |
async def _(e): | |
await start(e) | |
@cbot.on(events.NewMessage(pattern="/ping")) | |
async def _(e): | |
await up(e) | |
@cbot.on(events.NewMessage(pattern="/help")) | |
async def _(e): | |
await help(e) | |
######## Callbacks ######### | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"sshot(.*)"))) | |
async def _(e): | |
await screenshot(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"gsmpl(.*)"))) | |
async def _(e): | |
await sample(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"skip(.*)"))) | |
async def _(e): | |
await skip(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"stats(.*)"))) | |
async def _(e): | |
await stats(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"encc(.*)"))) | |
async def _(e): | |
await encc(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"sencc(.*)"))) | |
async def _(e): | |
await sencc(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"ccom(.*)"))) | |
async def _(e): | |
await ccom(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile(b"back(.*)"))) | |
async def _(e): | |
await back(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile("ihelp"))) | |
async def _(e): | |
await ihelp(e) | |
@cbot.on(events.callbackquery.CallbackQuery(data=re.compile("beck"))) | |
async def _(e): | |
await beck(e) | |
########## Direct ########### | |
@cbot.on(events.NewMessage(pattern="/eval")) | |
async def _(e): | |
await eval(e) | |
@cbot.on(events.NewMessage(pattern="/bash")) | |
async def _(e): | |
await bash(e) | |
########## AUTO ########### | |
@cbot.on(events.NewMessage(incoming=True)) | |
async def _(e): | |
await encod(e) | |
########### Start ############ | |
LOGS.info("Bot has started.") | |
cbot.run_until_disconnected() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment