I am trying to create a variable that every time a command/function is called upon, it will add to the variable.
import discord
import asyncio
from discord.ext import commands
botToken = 'TOKEN'
bot = commands.Bot(command_prefix = '#')
@bot.event
async def on_ready():
print('Bot is online and ready.')
varible1 = 1
async def changeVariable(ctx, *, orderItem):
varible1 = variable1 + 1
print(variable1)
It tells me that the variable is not assigned/referenced before assignment. Is there a way to make like a global function? I can try to give more details if needed.