import discord
from discord.ext import commands
bot = commands.Bot(command_prefix=".")
bot.remove_command('help')
total_commands = 0
total_usage = 0
total_users = 0
@bot.event
async def on_ready():
print("Bot is ready")
@bot.command()
async def help(ctx):
await ctx.send("Which help page? say 'commands' for commands 'home' for home page")
def check(msg):
return msg.author == ctx.author and msg.channel == ctx.channel and \
msg.content.lower() in ["home", "commands"]
msg = await bot.wait_for("message", check=check)
if msg.content.lower() == "home":
embed = discord.Embed(title="**Home Menu**", description=f"Total usage: {total_usage}\n\nTotal Commands Ran: {total_commands}\n\nTotal Users: {total_users}", color=discord.Color.from_rgb(0, 191, 255))
embed.set_footer(icon_url=f"{ctx.author.avatar_url}", text="Seppuku V2.0")
await ctx.send(embed=embed)
total_commands = total_commands + 1
elif msg.content.lower() == "commands":
embed = discord.Embed(title="**Coming Soon**", description="**Coming Soon**", color=discord.Color.from_rgb(0, 191, 255))
embed.set_footer(icon_url=f"{ctx.author.avatar_url}", text="Seppuku V2.0")
await ctx.send(embed=embed)
total_commands = total_commands + 1
The error I am getting is with the total_commands = total_commands + 1
line:
local variable 'total_commands' defined in enclosing scope on line 8 referenced before assignment
If someone could help that'd be nice :)