lunarflu HF staff commited on
Commit
015591e
1 Parent(s): 50fe0d8

Synced repo using 'sync_with_huggingface' Github Action

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