-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
24 lines (19 loc) · 824 Bytes
/
test.py
File metadata and controls
24 lines (19 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import stub as libcurrency
import asyncio
currency = libcurrency.Token()
async def main():
await currency.start() # Needs to be ran once at the start of the bot. This is the function that gives currency over time.
print(currency.check_balance("NoOne")) # Prints the current balance
try:
currency.remove_balance("NoOne", 2) # Attempt to lower the balance (succesfully)
print(currency.check_balance("NoOne"))
except Exception as e:
print(e)
currency.set_balance("NoOne", 8) # Set the balance to a specific *positive* value
print(currency.check_balance("NoOne"))
try:
currency.remove_balance("NoOne", 10) # Attempt to lower the balance (unsuccesfully)
print(currency.check_balance("NoOne"))
except Exception as e:
print(e)
asyncio.run(main())