forked from dannybd/puzzcord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
discord_info.py
61 lines (45 loc) · 1.46 KB
/
discord_info.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
""" Utility functions for getting information about discord channels, users, etc. """
import discord
GUILD_ID = 790341470171168800
VISITOR_ROLE = 795153098749771776
HUNT_MEMBER_ROLE = 790341818885734430
PUZZTECH_ROLE = 790341841916002335
PUZZBOSS_ROLE = 799032063725535242
BETABOSS_ROLE = 794351348295663616
WELCOME_LOBBY = 790341470602264576
PUZZTECH_CHANNEL = 790387626531225611
STATUS_CHANNEL = 790348440890507285
TABLE_REPORT_CHANNEL = 800167637354283038
PUZZLE_CATEGORY = 790343785804201984
SOLVED_PUZZLE_CATEGORY = 794869543448084491
def get_team_members(guild):
return guild.get_role(HUNT_MEMBER_ROLE).members
def is_puzzboss(member):
return PUZZBOSS_ROLE in [role.id for role in member.roles]
def is_puzzle_channel(channel):
if channel.type != discord.ChannelType.text:
return False
category = channel.category
if not category:
return False
catname = category.name
return catname.startswith("🧩") or catname.startswith("🏁") or catname.startswith("🚫")
def get_table(member):
voice = member.voice
if not voice:
return None
channel = voice.channel
if not channel:
return None
category = channel.category
if not category:
return None
if "tables" not in category.name.lower():
return None
return channel
def get_tables(ctx):
return [
channel
for channel in ctx.guild.voice_channels
if "tables" in str(channel.category).lower()
]