Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Synced repo using 'sync_with_huggingface' Github Action
Browse files
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 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
if
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
if
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
if
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
if
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
if
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
if
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
if
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 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 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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}")
|