Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions framework/isobot/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, db_path: str, log_path: str):

def save(self, data: dict) -> int:
"""Dumps all cached data to your local machine."""
with open(self.db_path, 'w+', encoding="utf8") as f: json.dump(data, f)
with open(self.db_path, 'w+', encoding="utf-8") as f: json.dump(data, f)
return 0

def load(self) -> dict:
Expand Down Expand Up @@ -90,7 +90,7 @@ def bank_remove(self, user: discord.User, amount: int) -> int:
currency["bank"][str(user)] -= int(amount)
self.save(currency)
with open(self.log_path, 'a') as f:
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Removed {amount} coins from bank\n')
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Removed {amount} coins from bank.\n')
f.close()
self.log(f"")
return 0
Expand All @@ -103,7 +103,7 @@ def reset(self, user: discord.User) -> int:
self.save(currency)
print(f"[Framework/CurrencyAPI] Currency data for \"{user}\" has been wiped")
with open(self.log_path, 'a') as f:
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Wiped all currency data\n')
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Wiped all currency data.\n')
f.close()
self.log(f"")
return 0
Expand All @@ -116,7 +116,7 @@ def deposit(self, user: discord.User, amount: int) -> int:
self.save(currency)
print(f"[Framework/CurrencyAPI] Moved {amount} coins to bank. User: {user} [{user}]")
with open(self.log_path, 'a') as f:
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Moved {amount} coins from wallet to bank\n')
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Moved {amount} coins from wallet to bank.\n')
f.close()
self.log(f"")
return 0
Expand All @@ -129,7 +129,7 @@ def withdraw(self, user: discord.User, amount: int) -> int:
self.save(currency)
print(f"[Framework/CurrencyAPI] Moved {amount} coins to wallet. User: {user} [{user}]")
with open(self.log_path, 'a') as f:
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Moved {amount} coins from bank to wallet\n')
f.write(f'{self.get_time()} framework.isobot.currency User({user}): Moved {amount} coins from bank to wallet.\n')
f.close()
self.log(f"")
return 0
Expand All @@ -140,7 +140,7 @@ def treasury_add(self, amount: int) -> int:
currency["treasury"] += int(amount)
self.save(currency)
with open(self.log_path, 'a') as f:
f.write(f'{self.get_time()} framework.isobot.currency Treasury: Added {amount} coins to treasury\n')
f.write(f'{self.get_time()} framework.isobot.currency Treasury: Added {amount} coins to treasury.\n')
f.close()
self.log(f"")
return 0
Expand Down