Spaces:
Sleeping
Sleeping
iamgojoof6eyes
commited on
Commit
·
c857510
1
Parent(s):
8f3b78a
added few things
Browse files- Powers/plugins/start.py +16 -15
- Powers/utils/chat_type.py +4 -1
Powers/plugins/start.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
-
from pyrogram import filters
|
2 |
from pyrogram.errors import MessageNotModified, QueryIdInvalid, UserIsBlocked
|
3 |
from pyrogram.types import CallbackQuery, Message
|
4 |
|
5 |
from Powers import HELP_COMMANDS, LOGGER
|
6 |
from Powers.bot_class import Gojo
|
7 |
from Powers.utils.custom_filters import command
|
|
|
8 |
from Powers.utils.kbhelpers import ikb
|
9 |
from Powers.utils.chat_type import chattype
|
10 |
from Powers.utils.start_utils import (
|
@@ -28,7 +29,7 @@ async def donate(_, m: Message):
|
|
28 |
|
29 |
All the fund would be put into my services such as database, storage and hosting!
|
30 |
|
31 |
-
You can donate by contacting my owner: [Captain Ezio](
|
32 |
"""
|
33 |
|
34 |
LOGGER.info(f"{m.from_user.id} fetched donation text in {m.chat.id}")
|
@@ -62,8 +63,8 @@ async def close_admin_callback(_, q: CallbackQuery):
|
|
62 |
command("start") & (filters.group | filters.private),
|
63 |
)
|
64 |
async def start(c: Gojo, m: Message):
|
65 |
-
chattype =
|
66 |
-
if chattype:
|
67 |
if len(m.text.split()) > 1:
|
68 |
help_option = (m.text.split(None, 1)[1]).lower()
|
69 |
|
@@ -93,7 +94,7 @@ async def start(c: Gojo, m: Message):
|
|
93 |
return
|
94 |
try:
|
95 |
cpt=f"""
|
96 |
-
Hey {m.from_user.first_name}! My self Gojo
|
97 |
I'm here to help you manage your groups!
|
98 |
Hit /help to find out more about how to use me in my full potential!
|
99 |
|
@@ -119,8 +120,8 @@ async def start(c: Gojo, m: Message):
|
|
119 |
@Gojo.on_callback_query(filters.regex("^start_back$"))
|
120 |
async def start_back(_, q: CallbackQuery):
|
121 |
try:
|
122 |
-
cpt="""
|
123 |
-
Hey
|
124 |
I'm here to help you manage your groups!
|
125 |
Hit /help to find out more about how to use me in my full potential!
|
126 |
|
@@ -146,8 +147,8 @@ async def commands_menu(_, q: CallbackQuery):
|
|
146 |
],
|
147 |
)
|
148 |
try:
|
149 |
-
cpt="""
|
150 |
-
Hey
|
151 |
I'm here to help you manage your groups!
|
152 |
Commands available:
|
153 |
* /start: Start the bot
|
@@ -182,8 +183,8 @@ async def help_menu(_, m: Message):
|
|
182 |
LOGGER.info(
|
183 |
f"{m.from_user.id} fetched help for '{help_option}' text in {m.chat.id}",
|
184 |
)
|
185 |
-
chattype =
|
186 |
-
if chattype:
|
187 |
await m.reply_photo(
|
188 |
photo="https://te.legra.ph/file/4bf3b88115068d41efadd.jpg",
|
189 |
caption=help_msg,
|
@@ -209,16 +210,16 @@ async def help_menu(_, m: Message):
|
|
209 |
),
|
210 |
)
|
211 |
else:
|
212 |
-
chattype =
|
213 |
-
if chattype:
|
214 |
keyboard = ikb(
|
215 |
[
|
216 |
*(await gen_cmds_kb(m)),
|
217 |
[("« Back", "start_back")],
|
218 |
],
|
219 |
)
|
220 |
-
msg =
|
221 |
-
Hey
|
222 |
I'm here to help you manage your groups!
|
223 |
Commands available:
|
224 |
* /start: Start the bot
|
|
|
1 |
+
from pyrogram import filters
|
2 |
from pyrogram.errors import MessageNotModified, QueryIdInvalid, UserIsBlocked
|
3 |
from pyrogram.types import CallbackQuery, Message
|
4 |
|
5 |
from Powers import HELP_COMMANDS, LOGGER
|
6 |
from Powers.bot_class import Gojo
|
7 |
from Powers.utils.custom_filters import command
|
8 |
+
from Powers.utils.chat_type import chattype
|
9 |
from Powers.utils.kbhelpers import ikb
|
10 |
from Powers.utils.chat_type import chattype
|
11 |
from Powers.utils.start_utils import (
|
|
|
29 |
|
30 |
All the fund would be put into my services such as database, storage and hosting!
|
31 |
|
32 |
+
You can donate by contacting my owner: [Captain Ezio](http://t.me/iamgojoof6eyes)
|
33 |
"""
|
34 |
|
35 |
LOGGER.info(f"{m.from_user.id} fetched donation text in {m.chat.id}")
|
|
|
63 |
command("start") & (filters.group | filters.private),
|
64 |
)
|
65 |
async def start(c: Gojo, m: Message):
|
66 |
+
chattype = chattype(m)
|
67 |
+
if chattype == "private":
|
68 |
if len(m.text.split()) > 1:
|
69 |
help_option = (m.text.split(None, 1)[1]).lower()
|
70 |
|
|
|
94 |
return
|
95 |
try:
|
96 |
cpt=f"""
|
97 |
+
Hey [{m.from_user.first_name}](http://t.me/{m.from_user.username})! My self Gojo ✨.
|
98 |
I'm here to help you manage your groups!
|
99 |
Hit /help to find out more about how to use me in my full potential!
|
100 |
|
|
|
120 |
@Gojo.on_callback_query(filters.regex("^start_back$"))
|
121 |
async def start_back(_, q: CallbackQuery):
|
122 |
try:
|
123 |
+
cpt=f"""
|
124 |
+
Hey [{q.from_user.first_name}](http://t.me/{q.from_user.username})! My name is Gojo ✨.
|
125 |
I'm here to help you manage your groups!
|
126 |
Hit /help to find out more about how to use me in my full potential!
|
127 |
|
|
|
147 |
],
|
148 |
)
|
149 |
try:
|
150 |
+
cpt=f"""
|
151 |
+
Hey **[{q.from_user.first_name}](http://t.me/{q.from_user.username})**! My name is Gojo✨.
|
152 |
I'm here to help you manage your groups!
|
153 |
Commands available:
|
154 |
* /start: Start the bot
|
|
|
183 |
LOGGER.info(
|
184 |
f"{m.from_user.id} fetched help for '{help_option}' text in {m.chat.id}",
|
185 |
)
|
186 |
+
chattype = chattype(m)
|
187 |
+
if chattype == "private":
|
188 |
await m.reply_photo(
|
189 |
photo="https://te.legra.ph/file/4bf3b88115068d41efadd.jpg",
|
190 |
caption=help_msg,
|
|
|
210 |
),
|
211 |
)
|
212 |
else:
|
213 |
+
chattype = chattype(m)
|
214 |
+
if chattype == "privaate":
|
215 |
keyboard = ikb(
|
216 |
[
|
217 |
*(await gen_cmds_kb(m)),
|
218 |
[("« Back", "start_back")],
|
219 |
],
|
220 |
)
|
221 |
+
msg =f"""
|
222 |
+
Hey **[{m.from_user.first_name}](http://t.me/{m.from_user.username})**!My name is Gojo✨.
|
223 |
I'm here to help you manage your groups!
|
224 |
Commands available:
|
225 |
* /start: Start the bot
|
Powers/utils/chat_type.py
CHANGED
@@ -12,7 +12,10 @@ async def chattype(m: Message):
|
|
12 |
if bool(m.chat and m.chat.type in {ChatType.PRIVATE}):
|
13 |
ct = "private"
|
14 |
|
15 |
-
if bool(m.chat and m.chat.type in {ChatType.
|
|
|
|
|
|
|
16 |
ct = "supergroup"
|
17 |
|
18 |
if bool(m.chat and m.chat.type in {ChatType.BOT}):
|
|
|
12 |
if bool(m.chat and m.chat.type in {ChatType.PRIVATE}):
|
13 |
ct = "private"
|
14 |
|
15 |
+
if bool(m.chat and m.chat.type in {ChatType.GROUP}):
|
16 |
+
ct="group"
|
17 |
+
|
18 |
+
if bool(m.chat and m.chat.type in {ChatType.SUPERGROUP}):
|
19 |
ct = "supergroup"
|
20 |
|
21 |
if bool(m.chat and m.chat.type in {ChatType.BOT}):
|