Spaces:
Paused
Paused
iamgojoof6eyes
commited on
Commit
·
15ce15c
1
Parent(s):
98572d5
Tried to fix
Browse files
Powers/plugins/start.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from pyrogram import filters
|
| 2 |
from pyrogram.errors import MessageNotModified, QueryIdInvalid, UserIsBlocked
|
| 3 |
from pyrogram.types import CallbackQuery, Message
|
| 4 |
|
|
@@ -61,7 +61,8 @@ async def close_admin_callback(_, q: CallbackQuery):
|
|
| 61 |
command("start") & (filters.group | filters.private),
|
| 62 |
)
|
| 63 |
async def start(c: Gojo, m: Message):
|
| 64 |
-
|
|
|
|
| 65 |
if len(m.text.split()) > 1:
|
| 66 |
help_option = (m.text.split(None, 1)[1]).lower()
|
| 67 |
|
|
@@ -180,7 +181,8 @@ async def help_menu(_, m: Message):
|
|
| 180 |
LOGGER.info(
|
| 181 |
f"{m.from_user.id} fetched help for '{help_option}' text in {m.chat.id}",
|
| 182 |
)
|
| 183 |
-
|
|
|
|
| 184 |
await m.reply_photo(
|
| 185 |
photo="https://te.legra.ph/file/4bf3b88115068d41efadd.jpg",
|
| 186 |
caption=help_msg,
|
|
@@ -206,7 +208,8 @@ async def help_menu(_, m: Message):
|
|
| 206 |
),
|
| 207 |
)
|
| 208 |
else:
|
| 209 |
-
|
|
|
|
| 210 |
keyboard = ikb(
|
| 211 |
[
|
| 212 |
*(await gen_cmds_kb(m)),
|
|
|
|
| 1 |
+
from pyrogram import filters, enums
|
| 2 |
from pyrogram.errors import MessageNotModified, QueryIdInvalid, UserIsBlocked
|
| 3 |
from pyrogram.types import CallbackQuery, Message
|
| 4 |
|
|
|
|
| 61 |
command("start") & (filters.group | filters.private),
|
| 62 |
)
|
| 63 |
async def start(c: Gojo, m: Message):
|
| 64 |
+
chattype = bool(m.chat and m.chat.type in {enums.ChatType.PRIVATE})
|
| 65 |
+
if chattype:
|
| 66 |
if len(m.text.split()) > 1:
|
| 67 |
help_option = (m.text.split(None, 1)[1]).lower()
|
| 68 |
|
|
|
|
| 181 |
LOGGER.info(
|
| 182 |
f"{m.from_user.id} fetched help for '{help_option}' text in {m.chat.id}",
|
| 183 |
)
|
| 184 |
+
chattype = bool(m.chat and m.chat.type in {enums.ChatType.PRIVATE})
|
| 185 |
+
if chattype:
|
| 186 |
await m.reply_photo(
|
| 187 |
photo="https://te.legra.ph/file/4bf3b88115068d41efadd.jpg",
|
| 188 |
caption=help_msg,
|
|
|
|
| 208 |
),
|
| 209 |
)
|
| 210 |
else:
|
| 211 |
+
chattype = bool(m.chat and m.chat.type in {enums.ChatType.PRIVATE})
|
| 212 |
+
if chattype:
|
| 213 |
keyboard = ikb(
|
| 214 |
[
|
| 215 |
*(await gen_cmds_kb(m)),
|
Powers/utils/custom_filters.py
CHANGED
|
@@ -37,7 +37,7 @@ def command(
|
|
| 37 |
if chattype:
|
| 38 |
return
|
| 39 |
|
| 40 |
-
if not m.from_user:
|
| 41 |
return False
|
| 42 |
|
| 43 |
if m.from_user.is_bot:
|
|
|
|
| 37 |
if chattype:
|
| 38 |
return
|
| 39 |
|
| 40 |
+
if m and not m.from_user:
|
| 41 |
return False
|
| 42 |
|
| 43 |
if m.from_user.is_bot:
|