Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How to allow discord bot to respond to webhook. Python. Discord.py

@client.event
async def on_message(message):
    # Manually get the invocation context from the message
    ctx = await client.get_context(message)

    # Verify that the context has a command and can be used
    if ctx.valid:
        # Invoke the command using the earlier defined bot/client/command
        await client.invoke(ctx)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #discord #bot #respond
ADD COMMENT
Topic
Name
8+8 =