Skip to content

Commit 7bba633

Browse files
authored
Fixed
1 parent 2f5b1e5 commit 7bba633

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

plugins/start.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import asyncio
44
from pyrogram import Client, filters, __version__
5-
5+
from pyrogram import Bot
66
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
77
from pyrogram.errors import FloodWait
88

@@ -11,16 +11,25 @@
1111
from helper_func import subscribed, encode, decode, get_messages
1212
from database.support import users_info
1313
from database.sql import add_user, query_msg
14+
15+
1416
########₹₹₹₹#################₹#₹₹₹₹₹!₹###########₹₹₹₹₹₹₹₹##₹#####
17+
1518
USERS_LIST = """<b>⭕️Total:</b>\n\n⭕️Subscribers - {}\n⭕️Blocked- {}"""
1619

1720
WAIT_MSG = """"<b>Processing ...</b>"""
1821

1922
REPLY_ERROR = """<code>Use this command as a replay to any telegram message with out any spaces.</code>"""
2023

24+
2125
#########₹₹₹₹#################₹#₹₹₹₹₹!₹###########₹₹₹₹₹₹₹₹##₹#####
26+
27+
2228
@Bot.on_message(filters.command('start') & filters.private & subscribed)
2329
async def start_command(client: Client, message: Message):
30+
id = m.from_user.id
31+
user_name = '@' + m.from_user.username if m.from_user.username else None
32+
await add_user(id, user_name)
2433
text = message.text
2534
if len(text)>7:
2635
try:
@@ -119,13 +128,6 @@ async def not_joined(client: Client, message: Message):
119128
disable_web_page_preview = True
120129
)
121130

122-
@Bot.on_message(filters.private & filters.command('start'))
123-
async def start_bot(bot, m: Message):
124-
id = m.from_user.id
125-
user_name = '@' + m.from_user.username if m.from_user.username else None
126-
await add_user(id, user_name)
127-
128-
129131
@Bot.on_message(filters.private & filters.command('users'))
130132
async def subscribers_count(bot, m: Message):
131133
id = m.from_user.id
@@ -164,4 +166,4 @@ async def send_text(bot, m: Message):
164166
else:
165167
msg = await m.reply_text(REPLY_ERROR, m.message_id)
166168
await asyncio.sleep(8)
167-
await msg.delete()
169+
await msg.delete()

0 commit comments

Comments
 (0)