-
Notifications
You must be signed in to change notification settings - Fork 1
/
playmode.py
42 lines (39 loc) · 1.24 KB
/
playmode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from pyrogram import filters
from pyrogram.types import InlineKeyboardMarkup, Message
from strings.filters import command
from config import BANNED_USERS
from strings import get_command
from AnonX import app
from AnonX.utils.database import (get_playmode, get_playtype,
is_nonadmin_chat)
from AnonX.utils.decorators import language
from AnonX.utils.inline.settings import playmode_users_markup
### Commands
PLAYMODE_COMMAND = get_command("PLAYMODE_COMMAND")
@app.on_message(
command(PLAYMODE_COMMAND)
& filters.group
& ~BANNED_USERS
)
@language
async def playmode_(client, message: Message, _):
playmode = await get_playmode(message.chat.id)
if playmode == "Direct":
Direct = True
else:
Direct = None
is_non_admin = await is_nonadmin_chat(message.chat.id)
if not is_non_admin:
Group = True
else:
Group = None
playty = await get_playtype(message.chat.id)
if playty == "Everyone":
Playtype = None
else:
Playtype = True
buttons = playmode_users_markup(_, Direct, Group, Playtype)
response = await message.reply_text(
_["playmode_1"].format(message.chat.title),
reply_markup=InlineKeyboardMarkup(buttons),
)