I have defined a variable called 'prefix' within my bot.py file which can be used in commands later, such as be displayed to the user. It's purpose is to simply store the bots prefix. However, I can't figure out how to use this variable in other cog files.
bot.py file: Variable Defined.
prefix = '!'
a cog file: Variable Tried to be used. (Final Line)
def setup(bot):
bot.add_cog(CogName(bot))
class CogName(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def help(self, ctx):
await ctx.send(f'For commands, use {prefix}commands')
How would I retrieve the variable I defined in the bot.py file and use it in the cog file?