Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,11 +16,16 @@ bot = commands.Bot(command_prefix='!', intents=intents)
|
|
| 16 |
|
| 17 |
""""""
|
| 18 |
XP_PER_MESSAGE = 10 # 100k messages = 1M exp = lvl 100
|
| 19 |
-
def calculate_level(xp):
|
| 20 |
-
return int(xp ** (1.0 / 3.0))
|
| 21 |
""""""
|
| 22 |
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
try:
|
|
@@ -45,16 +50,14 @@ async def on_message(message):
|
|
| 45 |
|
| 46 |
xp_data[author_id] += XP_PER_MESSAGE
|
| 47 |
print(f"xp_data: {xp_data}")
|
| 48 |
-
|
| 49 |
save_xp_data()
|
| 50 |
-
|
| 51 |
await bot.process_commands(message)
|
| 52 |
-
|
| 53 |
except Exception as e:
|
| 54 |
print(f"Error: {e}")
|
| 55 |
|
| 56 |
|
| 57 |
-
|
|
|
|
| 58 |
|
| 59 |
|
| 60 |
@bot.command()
|
|
@@ -95,13 +98,7 @@ async def top_users(ctx, limit: int = 10):
|
|
| 95 |
"""
|
| 96 |
|
| 97 |
|
| 98 |
-
|
| 99 |
-
async def on_ready():
|
| 100 |
-
print(f'Logged in as {bot.user.name}')
|
| 101 |
-
print(f"XP_PER_MESSAGE: {XP_PER_MESSAGE}")
|
| 102 |
-
print(f"xp_data: {xp_data}")
|
| 103 |
-
for author in xp_data:
|
| 104 |
-
print(f"XP people: {author}")
|
| 105 |
|
| 106 |
|
| 107 |
|
|
|
|
| 16 |
|
| 17 |
""""""
|
| 18 |
XP_PER_MESSAGE = 10 # 100k messages = 1M exp = lvl 100
|
|
|
|
|
|
|
| 19 |
""""""
|
| 20 |
|
| 21 |
|
| 22 |
+
@bot.event
|
| 23 |
+
async def on_ready():
|
| 24 |
+
print(f'Logged in as {bot.user.name}')
|
| 25 |
+
print(f"XP_PER_MESSAGE: {XP_PER_MESSAGE}")
|
| 26 |
+
print(f"xp_data: {xp_data}")
|
| 27 |
+
for author in xp_data:
|
| 28 |
+
print(f"XP people: {author}")
|
| 29 |
|
| 30 |
|
| 31 |
try:
|
|
|
|
| 50 |
|
| 51 |
xp_data[author_id] += XP_PER_MESSAGE
|
| 52 |
print(f"xp_data: {xp_data}")
|
|
|
|
| 53 |
save_xp_data()
|
|
|
|
| 54 |
await bot.process_commands(message)
|
|
|
|
| 55 |
except Exception as e:
|
| 56 |
print(f"Error: {e}")
|
| 57 |
|
| 58 |
|
| 59 |
+
def calculate_level(xp):
|
| 60 |
+
return int(xp ** (1.0 / 3.0))
|
| 61 |
|
| 62 |
|
| 63 |
@bot.command()
|
|
|
|
| 98 |
"""
|
| 99 |
|
| 100 |
|
| 101 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
|
| 104 |
|