F
F
F1azy2022-04-18 17:23:46
Python
F1azy, 2022-04-18 17:23:46

Why is the message sent to the wrong channel?

@bot.command(pass_context=True)
@commands.has_permissions(administrator=True)
async def бан(ctx, member: discord.Member, *, days, reason=None):
    channel = bot.get_channel(964228426066194482)
    await member.ban(reason=reason)
    await ctx.channel.purge(limit = 0)
    emb = discord.Embed(color=0x9b59b6)
    author = ctx.message.author
    emb.add_field(name="✅ Бан", value='Пользователь {} был забанен!'.format(member.mention))
    emb.add_field(name="Модератор", value = ctx.message.author.mention, inline = False)
    await ctx.send(embed = emb)


This message about the ban should be sent to the channel that I indicated above, but for some reason this message is sent to the channel in which I registered this command.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-04-18
@F1azy

> ctx.send
Indeed, why? Maybe because you're telling the bot to send it there?
If you need to send to channel, then channel.send().

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question