OtakuMegane / DerpyBot

An active learning chatbot using Markov chains.
MIT License
5 stars 3 forks source link

AttributeError: 'TextChannel' object has no attribute 'respond' #12

Closed ImDevCoder69 closed 2 years ago

ImDevCoder69 commented 2 years ago
@bot.slash_command()
async def balance(ctx, user: discord.User = None):
    if user != None:
        userid = user.id
    else:
        userid = ctx.author.id
    with open("users.json", "r+") as f:
        data = json.load(f)
    if str(userid) in data:
        balance = data[str(userid)]["balance"]
        await ctx.channel.respond(
            f"{ctx.author.mention} has **⏣{balance}** in their wallet."
        )
OtakuMegane commented 2 years ago

Outside of project scope.