0
votes

I am making a bot in discord.py and want my bot to ping a role when a Webhook sends message in a specific channel. Is there anyway to do this? Right now all I have is the channel id and I am pretty sure it is a client Event

@client.event
async def pingrole():
  channel = client.get_channel("channel id")
1
You have to use an on_message event and check for messagesDominik
I forgot to mention, it is a Webhook, So I Want the bot to ping when the Webhook posts somethingChaoticNebula
You would still have to use an on_message event.Dominik
You can use on_message as @Dominik said, get role by id and then mention it using .mention. Example: role = guild.get_role(id) role.mention and then you can send it as message.RiveN

1 Answers

0
votes
async def on_message(message):
    if message.author.id == webhook.id:
        await ctx.send(role.mention)