This commit is contained in:
levina 2022-02-12 11:40:23 +07:00 committed by GitHub
parent dbbfb46f0c
commit 25394eca71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,16 +1,19 @@
import asyncio import asyncio
from driver.core import user
from pyrogram.types import Message
from pyrogram import Client, filters
from config import BOT_USERNAME, SUDO_USERS from config import BOT_USERNAME, SUDO_USERS
from driver.core import user
from driver.filters import command, other_filters from driver.filters import command, other_filters
from driver.database.dbchat import remove_served_chat from driver.database.dbchat import remove_served_chat
from driver.database.dbqueue import remove_active_chat from driver.database.dbqueue import remove_active_chat
from driver.database.dbpunish import is_gbanned_user from driver.database.dbpunish import is_gbanned_user
from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
from driver.decorators import authorized_users_only, bot_creator from driver.decorators import authorized_users_only, bot_creator
from pyrogram.types import Message
from pyrogram import Client, filters
from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
@Client.on_message( @Client.on_message(
command(["userbotjoin", f"userbotjoin@{BOT_USERNAME}"]) & other_filters command(["userbotjoin", f"userbotjoin@{BOT_USERNAME}"]) & other_filters
@ -23,7 +26,6 @@ async def join_chat(c: Client, m: Message):
await m.reply_text("❗️ **You've blocked from using this bot!**") await m.reply_text("❗️ **You've blocked from using this bot!**")
return return
try: try:
# If it exists, use it.
invitelink = (await c.get_chat(chat_id)).invite_link invitelink = (await c.get_chat(chat_id)).invite_link
if not invitelink: if not invitelink:
await c.export_chat_invite_link(chat_id) await c.export_chat_invite_link(chat_id)