-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp_command.py
More file actions
108 lines (97 loc) · 4.56 KB
/
Copy pathhelp_command.py
File metadata and controls
108 lines (97 loc) · 4.56 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
from config import bot
from db_helpers import get_user_info
@bot.message_handler(commands=['help'])
def help_command(message):
user = get_user_info(message.from_user.id)
if not user:
help_text = (
"📖 Available Commands:\n"
"🏁 /start - Register or login\n"
"🆔 /getid - Get your Telegram User ID\n"
"\n💬 For further assistance, contact: @winstonzzk or @Jaredee"
)
bot.send_message(message.chat.id, help_text)
return
user_role = user["role"].strip().lower()
user_cca = user.get("cca", "").strip().lower()
user_block = user.get("block", "").strip().lower()
# Base commands available to all users
help_text = "📖 Available Commands:\n🏁 /start - Register or login\n🆔 /getid - Get your Telegram User ID\n"
if user_role == "admin":
help_text += (
"📋 /book - Start a venue booking\n"
"👀 /view - View all bookings across all venues\n"
"❌ /cancel - Cancel any booking\n"
"✏️ /edit - Edit your own bookings\n"
"⚙️ /admin_update - Update user roles and CCAs\n"
"🔄 /restart - Restart the bot\n"
)
elif user_role == "jcrc":
help_text += "📋 /book - Start a venue booking\n"
if user_cca == "welfare d":
help_text += (
"✅ /approve - Approve/reject Reading Room & Dining Hall bookings\n"
"👀 /view - View all Reading Room & Dining Hall bookings + your own\n"
"❌ /cancel - Cancel your own bookings + any Reading Room/Dining Hall bookings\n"
"✏️ /edit - Edit your own Reading Room & Dining Hall bookings\n"
)
elif user_cca in ["sports d", "culture d"]:
help_text += (
"📦 /mass_book - Submit multiple MPSH bookings at once\n"
"👀 /view - View all MPSH bookings + your own bookings\n"
"❌ /cancel - Cancel your own bookings + any MPSH bookings\n"
"✏️ /edit - Edit your own Reading Room, Dining Hall & MPSH bookings\n"
)
else:
help_text += (
"👀 /view - View your own bookings\n"
"❌ /cancel - Cancel your own bookings\n"
"✏️ /edit - Edit your own Reading Room & Dining Hall bookings\n"
)
elif user_role == "captain":
help_text += (
"📋 /book - Start a venue booking\n"
"📦 /mass_book - Submit multiple MPSH bookings at once\n"
"👀 /view - View your own bookings\n"
"❌ /cancel - Cancel your own bookings\n"
"✏️ /edit - Edit your own MPSH bookings\n"
)
elif user_role == "chairman":
if user_cca == "dance":
help_text += (
"📋 /book - Start a venue booking\n"
"📦 /mass_book - Submit multiple MPSH bookings at once\n"
"👀 /view - View your own bookings\n"
"❌ /cancel - Cancel your own bookings\n"
"✏️ /edit - Edit your own MPSH bookings\n"
)
elif user_cca in ["rockers", "inspire"]:
help_text += (
"📋 /book - Start a venue booking\n"
"👀 /view - View your own bookings\n"
"❌ /cancel - Cancel your own bookings\n"
"✏️ /edit - Edit your own Band Room bookings\n"
)
else:
help_text += (
"📋 /book - Start a venue booking\n"
"👀 /view - View your own bookings\n"
"❌ /cancel - Cancel your own bookings\n"
)
elif user_role == "block head":
block_display = user_block.title() if user_block else "Your Block"
help_text += (
"📋 /book - Start a venue booking\n"
f"✅ /approve - Approve/reject {block_display} Lounge bookings\n"
f"👀 /view - View all {block_display} Lounge bookings + your own\n"
f"❌ /cancel - Cancel your own bookings + any {block_display} Lounge bookings\n"
"✏️ /edit - Edit your own bookings\n"
)
else: # Regular residents
help_text += (
"📋 /book - Start a venue booking (requires approval)\n"
"👀 /view - View your own bookings only\n"
"❌ /cancel - Cancel your own bookings only\n"
)
help_text += "\n💬 For further assistance, contact: @winstonzzk or @Jaredee"
bot.send_message(message.chat.id, help_text)