Skip to content

Commit

Permalink
Update civ.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PyDroid1020 authored Feb 10, 2023
1 parent 4a2e831 commit 349d018
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Ci/civ.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,17 @@ def reset_member_xp(self , guild_id , member_id):
else:
cur.execute("UPDATE guild SET exp = 0 WHERE guild_id = ? AND user_id = ?", (guild_id, member_id))


class events:
def on_new_level(guild_id , member_id):
db = sqlite3.connect('./database/level.db' , isolation_level=None)
cur = db.execute("SELECT exp FROM guild WHERE guild_id = ? AND user_id = ?", (guild_id, member_id))
data = cur.fetchone()
exp = data[0]
lvl = math.sqrt(exp) / 1
if lvl.is_integer():
return lvl
else:
return False

class settings:
class guild:
Expand Down

0 comments on commit 349d018

Please sign in to comment.