@@ -44,7 +44,7 @@ def add(self, user: discord.User, amount: int) -> int:
44
44
"""Adds balance to the specified user."""
45
45
with open (self .db_path , 'r' ) as f : currency = json .load (f )
46
46
currency ["wallet" ][str (user )] += int (amount )
47
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
47
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
48
48
with open (self .log_path , 'a' ) as f :
49
49
f .write (f'{ self .get_time ()} framework.isobot.currency User({ user } ): Added { amount } coins to wallet\n ' )
50
50
f .close ()
@@ -54,7 +54,7 @@ def bank_add(self, user: discord.User, amount: int) -> int:
54
54
"""Adds balance to the specified user's bank account."""
55
55
with open (self .db_path , 'r' ) as f : currency = json .load (f )
56
56
currency ["bank" ][str (user )] += int (amount )
57
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
57
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
58
58
with open (self .log_path , 'a' ) as f :
59
59
f .write (f'{ self .get_time ()} framework.isobot.currency User({ user } ): Added { amount } coins to bank\n ' )
60
60
f .close ()
@@ -64,7 +64,7 @@ def remove(self, user: discord.User, amount: int) -> int:
64
64
"""Removes balance from the specified user."""
65
65
with open (self .db_path , 'r' ) as f : currency = json .load (f )
66
66
currency ["wallet" ][str (user )] -= int (amount )
67
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
67
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
68
68
with open (self .log_path , 'a' ) as f :
69
69
f .write (f'{ self .get_time ()} framework.isobot.currency User({ user } ): Removed { amount } coins from wallet\n ' )
70
70
f .close ()
@@ -74,7 +74,7 @@ def bank_remove(self, user: discord.User, amount: int) -> int:
74
74
"""Removes balance from the specified user's bank account."""
75
75
with open (self .db_path , 'r' ) as f : currency = json .load (f )
76
76
currency ["bank" ][str (user )] -= int (amount )
77
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
77
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
78
78
with open (self .log_path , 'a' ) as f :
79
79
f .write (f'{ self .get_time ()} framework.isobot.currency User({ user } ): Removed { amount } coins from bank\n ' )
80
80
f .close ()
@@ -85,7 +85,7 @@ def reset(self, user: discord.User) -> int:
85
85
with open (self .db_path , 'r' ) as f : currency = json .load (f )
86
86
currency ["wallet" ][str (user )] = 0
87
87
currency ["bank" ][str (user )] = 0
88
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
88
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
89
89
print (f"[Framework/CurrencyAPI] Currency data for \" { user } \" has been wiped" )
90
90
with open (self .log_path , 'a' ) as f :
91
91
f .write (f'{ self .get_time ()} framework.isobot.currency User({ user } ): Wiped all currency data\n ' )
@@ -97,7 +97,7 @@ def deposit(self, user: discord.User, amount: int) -> int:
97
97
with open (self .db_path , 'r' ) as f : currency = json .load (f )
98
98
currency ["bank" ][str (user )] += int (amount )
99
99
currency ["wallet" ][str (user )] -= int (amount )
100
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
100
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
101
101
print (f"[Framework/CurrencyAPI] Moved { amount } coins to bank. User: { user } [{ user } ]" )
102
102
with open (self .log_path , 'a' ) as f :
103
103
f .write (f'{ self .get_time ()} framework.isobot.currency User({ user } ): Moved { amount } coins from wallet to bank\n ' )
@@ -109,7 +109,7 @@ def withdraw(self, user: discord.User, amount: int) -> int:
109
109
with open (self .db_path , 'r' ) as f : currency = json .load (f )
110
110
currency ["wallet" ][str (user )] += int (amount )
111
111
currency ["bank" ][str (user )] -= int (amount )
112
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
112
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
113
113
print (f"[Framework/CurrencyAPI] Moved { amount } coins to wallet. User: { user } [{ user } ]" )
114
114
with open (self .log_path , 'a' ) as f :
115
115
f .write (f'{ self .get_time ()} framework.isobot.currency User({ user } ): Moved { amount } coins from bank to wallet\n ' )
@@ -119,7 +119,7 @@ def withdraw(self, user: discord.User, amount: int) -> int:
119
119
def treasury_add (self , amount : int ) -> int :
120
120
with open (self .db_path , 'r' ) as f : currency = json .load (f )
121
121
currency ["treasury" ] += int (amount )
122
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
122
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
123
123
with open (self .log_path , 'a' ) as f :
124
124
f .write (f'{ self .get_time ()} framework.isobot.currency Treasury: Added { amount } coins to treasury\n ' )
125
125
f .close ()
@@ -128,7 +128,7 @@ def treasury_add(self, amount: int) -> int:
128
128
def treasury_remove (self , amount : int ) -> int :
129
129
with open (self .db_path , 'r' ) as f : currency = json .load (f )
130
130
currency ["treasury" ] -= int (amount )
131
- with open (self .db_path , 'w+' ) as f : json .dump (currency , f , indent = 4 )
131
+ with open (self .db_path , 'w+' ) as f : json .dump (currency , f )
132
132
with open (self .log_path , 'a' ) as f :
133
133
f .write (f'{ self .get_time ()} framework.isobot.currency Treasury: Removed { amount } coins from treasury\n ' )
134
134
f .close ()
0 commit comments