Skip to content

Commit

Permalink
Update bot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
erotixe authored Jan 24, 2024
1 parent f5e0bc8 commit 8fa72ad
Showing 1 changed file with 34 additions and 11 deletions.
45 changes: 34 additions & 11 deletions bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#(©)Codexbotz
#(©)AnimeXyz

from aiohttp import web
from plugins import web_server
Expand All @@ -9,7 +9,13 @@
import sys
from datetime import datetime

from config import API_HASH, APP_ID, LOGGER, TG_BOT_TOKEN, TG_BOT_WORKERS, FORCE_SUB_CHANNEL, CHANNEL_ID, PORT
from config import API_HASH, APP_ID, LOGGER, TG_BOT_TOKEN, TG_BOT_WORKERS, FORCE_SUB_CHANNEL, FORCE_SUB_CHANNEL2, CHANNEL_ID, PORT


name ="""
BY MIKEY FROM TG
"""


class Bot(Client):
def __init__(self):
Expand Down Expand Up @@ -41,7 +47,20 @@ async def start(self):
self.LOGGER(__name__).warning(a)
self.LOGGER(__name__).warning("Bot can't Export Invite link from Force Sub Channel!")
self.LOGGER(__name__).warning(f"Please Double check the FORCE_SUB_CHANNEL value and Make sure Bot is Admin in channel with Invite Users via Link Permission, Current Force Sub Channel Value: {FORCE_SUB_CHANNEL}")
self.LOGGER(__name__).info("\nBot Stopped. Join https://t.me/CodeXBotzSupport for support")
self.LOGGER(__name__).info("\nBot Stopped. https://t.me/weebs_support for support")
sys.exit()
if FORCE_SUB_CHANNEL2:
try:
link = (await self.get_chat(FORCE_SUB_CHANNEL2)).invite_link
if not link:
await self.export_chat_invite_link(FORCE_SUB_CHANNEL2)
link = (await self.get_chat(FORCE_SUB_CHANNEL2)).invite_link
self.invitelink2 = link
except Exception as a:
self.LOGGER(__name__).warning(a)
self.LOGGER(__name__).warning("Bot can't Export Invite link from Force Sub Channel!")
self.LOGGER(__name__).warning(f"Please Double check the FORCE_SUB_CHANNEL2 value and Make sure Bot is Admin in channel with Invite Users via Link Permission, Current Force Sub Channel Value: {FORCE_SUB_CHANNEL2}")
self.LOGGER(__name__).info("\nBot Stopped. https://t.me/weebs_support for support")
sys.exit()
try:
db_channel = await self.get_chat(CHANNEL_ID)
Expand All @@ -51,18 +70,21 @@ async def start(self):
except Exception as e:
self.LOGGER(__name__).warning(e)
self.LOGGER(__name__).warning(f"Make Sure bot is Admin in DB Channel, and Double check the CHANNEL_ID Value, Current Value {CHANNEL_ID}")
self.LOGGER(__name__).info("\nBot Stopped. Join https://t.me/CodeXBotzSupport for support")
self.LOGGER(__name__).info("\nBot Stopped. Join https://t.me/weebs_support for support")
sys.exit()

self.set_parse_mode(ParseMode.HTML)
self.LOGGER(__name__).info(f"Bot Running..!\n\nCreated by \nhttps://t.me/CodeXBotz")
self.LOGGER(__name__).info(f"Bot Running..!\n\nCreated by \nhttps://t.me/weebs_support")
self.LOGGER(__name__).info(f""" \n\n
░█████╗░░█████╗░██████╗░███████╗██╗░░██╗██████╗░░█████╗░████████╗███████╗
██╔══██╗██╔══██╗██╔══██╗██╔════╝╚██╗██╔╝██╔══██╗██╔══██╗╚══██╔══╝╚════██║
██║░░╚═╝██║░░██║██║░░██║█████╗░░░╚███╔╝░██████╦╝██║░░██║░░░██║░░░░░███╔═╝
██║░░██╗██║░░██║██║░░██║██╔══╝░░░██╔██╗░██╔══██╗██║░░██║░░░██║░░░██╔══╝░░
╚█████╔╝╚█████╔╝██████╔╝███████╗██╔╝╚██╗██████╦╝╚█████╔╝░░░██║░░░███████╗
░╚════╝░░╚════╝░╚═════╝░╚══════╝╚═╝░░╚═╝╚═════╝░░╚════╝░░░░╚═╝░░░╚══════╝
▄▄▄▄███▄▄▄▄ ▄█ ▄█ ▄█▄ ▄████████ ▄██ ▄
▄██▀▀▀███▀▀▀██▄ ███ ███ ▄███▀ ███ ███ ███ ██▄
███ ███ ███ ███▌ ███▐██▀ ███ █▀ ███▄▄▄███
███ ███ ███ ███▌ ▄█████▀ ▄███▄▄▄ ▀▀▀▀▀▀███ @Codeflix_Bots
███ ███ ███ ███▌ ▀▀█████▄ ▀▀███▀▀▀ ▄██ ███
███ ███ ███ ███ ███▐██▄ ███ █▄ ███ ███
███ ███ ███ ███ ███ ▀███▄ ███ ███ ███ ███
▀█ ███ █▀ █▀ ███ ▀█▀ ██████████ ▀█████▀
""")
self.username = usr_bot_me.username
#web-response
Expand All @@ -74,3 +96,4 @@ async def start(self):
async def stop(self, *args):
await super().stop()
self.LOGGER(__name__).info("Bot stopped.")

0 comments on commit 8fa72ad

Please sign in to comment.