-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublicflags.py
91 lines (68 loc) · 1.75 KB
/
publicflags.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
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
class flag_value:
def __init__(self, func):
self.flag = func(None)
self.__doc__ = func.__doc__
def __get__(self, instance, owner):
return instance._has_flag(self.flag)
class UserFlags:
def __init__(self, value: int = 0):
self.value = value
def __repr__(self):
return '<%s value=%s>' % (self.__class__.__name__, self.value)
def __iter__(self):
for name, value in self.__class__.__dict__.items():
if isinstance(value, flag_value) and self._has_flag(value.flag):
yield name
def _has_flag(self, o):
return (self.value & o) == o
@flag_value
def discord_employee(self):
return 1 << 0
@flag_value
def discord_partner(self):
return 1 << 1
@flag_value
def hs_events(self):
return 1 << 2
@flag_value
def bug_hunter_lvl1(self):
return 1 << 3
@flag_value
def mfa_sms(self):
return 1 << 4
@flag_value
def premium_promo_dismissed(self):
return 1 << 5
@flag_value
def hs_bravery(self):
return 1 << 6
@flag_value
def hs_brilliance(self):
return 1 << 7
@flag_value
def hs_balance(self):
return 1 << 8
@flag_value
def early_supporter(self):
return 1 << 9
@flag_value
def team_user(self):
return 1 << 10
@flag_value
def system(self):
return 1 << 12
@flag_value
def unread_sys_msg(self):
return 1 << 13
@flag_value
def bug_hunter_lvl2(self):
return 1 << 14
@flag_value
def underage_deleted(self):
return 1 << 15
@flag_value
def verified_bot(self):
return 1 << 16
@flag_value
def verified_dev(self):
return 1 << 17