I want it to show 7 first, then 4, 1 when entering the command, but it always shows 7, 7, 7
@client.command()
async def test(ctx):
bint = 3
money1 = 10
if money1 >= 3:
money1 = money1 - bint
await ctx.send(money1)
I want it to show 7 first, then 4, 1 when entering the command, but it always shows 7, 7, 7
@client.command()
async def test(ctx):
bint = 3
money1 = 10
if money1 >= 3:
money1 = money1 - bint
await ctx.send(money1)
You can use a global variable for that or store the variable somewhere else. What I usually do is make a config.py
file in the base directory and then put variable there like
config.py
money1 = 10
in you code
import config
bint = 3
if config.money1 >= 3:
config.money1 - bint
await ctx.send(config.money1)
You can as well use your discord client (not recommend) like this:
try:
client.money1
except:
client.money1 = 10
...