Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
@@ -69,58 +69,124 @@ async def on_message(message):
|
|
69 |
|
70 |
|
71 |
try:
|
72 |
-
if message.author.id == 811235357663297546:
|
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 |
-
if current_level == 13:
|
105 |
-
if lvl13 not in message.author.roles:
|
106 |
-
await message.author.add_roles(lvl13)
|
107 |
-
print(f"Gave {message.author} {lvl13}")
|
108 |
-
await message.author.remove_roles(lvl12)
|
109 |
-
print(f"Removed {lvl12} from {message.author}")
|
110 |
-
|
111 |
-
if current_level == 14:
|
112 |
-
if lvl14 not in message.author.roles:
|
113 |
-
await message.author.add_roles(lvl14)
|
114 |
-
print(f"Gave {message.author} {lvl14}")
|
115 |
-
await message.author.remove_roles(lvl13)
|
116 |
-
print(f"Removed {lvl13} from {message.author}")
|
117 |
-
|
118 |
-
if current_level == 15:
|
119 |
-
if lvl15 not in message.author.roles:
|
120 |
-
await message.author.add_roles(lvl15)
|
121 |
-
print(f"Gave {message.author} {lvl15}")
|
122 |
-
await message.author.remove_roles(lvl14)
|
123 |
-
print(f"Removed {lvl14} from {message.author}")
|
124 |
|
125 |
except Exception as e:
|
126 |
print(f"Error: {e}")
|
|
|
69 |
|
70 |
|
71 |
try:
|
72 |
+
#if message.author.id == 811235357663297546:
|
73 |
+
# get level
|
74 |
+
guild = bot.get_guild(879548962464493619)
|
75 |
+
current_level = calculate_level(xp_data[author_id])
|
76 |
+
|
77 |
+
lvl1 = guild.get_role(1171861537699397733)
|
78 |
+
lvl2 = guild.get_role(1171861595115245699)
|
79 |
+
lvl3 = guild.get_role(1171861626715115591)
|
80 |
+
lvl4 = guild.get_role(1171861657975259206)
|
81 |
+
lvl5 = guild.get_role(1171861686580412497)
|
82 |
+
lvl6 = guild.get_role(1171861900301172736)
|
83 |
+
lvl7 = guild.get_role(1171861936258941018)
|
84 |
+
lvl8 = guild.get_role(1171861968597024868)
|
85 |
+
lvl9 = guild.get_role(1171862009982242836)
|
86 |
+
lvl10 = guild.get_role(1164188093713223721)
|
87 |
+
lvl11 = guild.get_role(1171524944354607104)
|
88 |
+
lvl12 = guild.get_role(1171524990257082458)
|
89 |
+
lvl13 = guild.get_role(1171525021928263791)
|
90 |
+
lvl14 = guild.get_role(1171525062201966724)
|
91 |
+
lvl15 = guild.get_role(1171525098465918996)
|
92 |
+
|
93 |
+
if current_level == 2:
|
94 |
+
if lvl11 not in message.author.roles:
|
95 |
+
await message.author.add_roles(lvl2)
|
96 |
+
print(f"Gave {message.author} {lvl2}")
|
97 |
+
await message.author.remove_roles(lvl1)
|
98 |
+
print(f"Removed {lvl1} from {message.author}")
|
99 |
+
|
100 |
+
if current_level == 3:
|
101 |
+
if lvl11 not in message.author.roles:
|
102 |
+
await message.author.add_roles(lvl3)
|
103 |
+
print(f"Gave {message.author} {lvl3}")
|
104 |
+
await message.author.remove_roles(lvl2)
|
105 |
+
print(f"Removed {lvl2} from {message.author}")
|
106 |
+
|
107 |
+
if current_level == 4:
|
108 |
+
if lvl11 not in message.author.roles:
|
109 |
+
await message.author.add_roles(lvl4)
|
110 |
+
print(f"Gave {message.author} {lvl4}")
|
111 |
+
await message.author.remove_roles(lvl3)
|
112 |
+
print(f"Removed {lvl3} from {message.author}")
|
113 |
+
|
114 |
+
if current_level == 5:
|
115 |
+
if lvl11 not in message.author.roles:
|
116 |
+
await message.author.add_roles(lvl5)
|
117 |
+
print(f"Gave {message.author} {lvl5}")
|
118 |
+
await message.author.remove_roles(lvl4)
|
119 |
+
print(f"Removed {lvl4} from {message.author}")
|
120 |
+
|
121 |
+
if current_level == 6:
|
122 |
+
if lvl11 not in message.author.roles:
|
123 |
+
await message.author.add_roles(lvl6)
|
124 |
+
print(f"Gave {message.author} {lvl6}")
|
125 |
+
await message.author.remove_roles(lvl5)
|
126 |
+
print(f"Removed {lvl5} from {message.author}")
|
127 |
+
|
128 |
+
if current_level == 7:
|
129 |
+
if lvl11 not in message.author.roles:
|
130 |
+
await message.author.add_roles(lvl7)
|
131 |
+
print(f"Gave {message.author} {lvl7}")
|
132 |
+
await message.author.remove_roles(lvl6)
|
133 |
+
print(f"Removed {lvl6} from {message.author}")
|
134 |
+
|
135 |
+
if current_level == 8:
|
136 |
+
if lvl11 not in message.author.roles:
|
137 |
+
await message.author.add_roles(lvl8)
|
138 |
+
print(f"Gave {message.author} {lvl8}")
|
139 |
+
await message.author.remove_roles(lvl7)
|
140 |
+
print(f"Removed {lvl7} from {message.author}")
|
141 |
+
|
142 |
+
if current_level == 9:
|
143 |
+
if lvl9 not in message.author.roles:
|
144 |
+
await message.author.add_roles(lvl9)
|
145 |
+
print(f"Gave {message.author} {lvl9}")
|
146 |
+
await message.author.remove_roles(lvl8)
|
147 |
+
print(f"Removed {lvl8} from {message.author}")
|
148 |
+
|
149 |
+
if current_level == 10:
|
150 |
+
if lvl10 not in message.author.roles:
|
151 |
+
await message.author.add_roles(lvl10)
|
152 |
+
print(f"Gave {message.author} {lvl10}")
|
153 |
+
await message.author.remove_roles(lvl9)
|
154 |
+
print(f"Removed {lvl9} from {message.author}")
|
155 |
+
|
156 |
+
if current_level == 11:
|
157 |
+
if lvl11 not in message.author.roles:
|
158 |
+
await message.author.add_roles(lvl11)
|
159 |
+
print(f"Gave {message.author} {lvl11}")
|
160 |
+
await message.author.remove_roles(lvl10)
|
161 |
+
print(f"Removed {lvl10} from {message.author}")
|
162 |
|
163 |
+
if current_level == 12:
|
164 |
+
if lvl12 not in message.author.roles:
|
165 |
+
await message.author.add_roles(lvl12)
|
166 |
+
print(f"Gave {message.author} {lvl12}")
|
167 |
+
await message.author.remove_roles(lvl11)
|
168 |
+
print(f"Removed {lvl11} from {message.author}")
|
169 |
+
|
170 |
+
if current_level == 13:
|
171 |
+
if lvl13 not in message.author.roles:
|
172 |
+
await message.author.add_roles(lvl13)
|
173 |
+
print(f"Gave {message.author} {lvl13}")
|
174 |
+
await message.author.remove_roles(lvl12)
|
175 |
+
print(f"Removed {lvl12} from {message.author}")
|
176 |
+
|
177 |
+
if current_level == 14:
|
178 |
+
if lvl14 not in message.author.roles:
|
179 |
+
await message.author.add_roles(lvl14)
|
180 |
+
print(f"Gave {message.author} {lvl14}")
|
181 |
+
await message.author.remove_roles(lvl13)
|
182 |
+
print(f"Removed {lvl13} from {message.author}")
|
183 |
|
184 |
+
if current_level == 15:
|
185 |
+
if lvl15 not in message.author.roles:
|
186 |
+
await message.author.add_roles(lvl15)
|
187 |
+
print(f"Gave {message.author} {lvl15}")
|
188 |
+
await message.author.remove_roles(lvl14)
|
189 |
+
print(f"Removed {lvl14} from {message.author}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
except Exception as e:
|
192 |
print(f"Error: {e}")
|