This commit is contained in:
2024-09-05 15:40:27 +02:00
parent 35249d9ea5
commit 86e46b8338
2 changed files with 3 additions and 8 deletions
+1 -7
View File
@@ -7,11 +7,8 @@ import time
aura = Aura()
client = discord.Client(intents=discord.Intents.all())
# bot = commands.Bot(command_prefix="!", intents=discord.Intents.all())
tree = app_commands.CommandTree(client)
COOLDOWN_PERIOD = 5
@client.event
async def on_ready():
print(client.user)
@@ -27,13 +24,10 @@ async def on_message(msg: discord.Message):
if msg.author.bot:
return
user = aura.get(str(msg.author.id))
time_elapsed = time.time() - user.last_earned
print(time_elapsed)
if time_elapsed >= COOLDOWN_PERIOD:
if int(time.time() - user.last_earned) >= COOLDOWN_PERIOD:
user.balance += 3
user.last_earned = time.time()
aura.update(user)
await client.process_commands(msg)
@client.event
async def on_member_join(member: discord.Member):