src/bot.py
async def on_message(message):
    ''' run on message sent to a channel '''
    # allow messages from test bot
    if message.author.bot and message.author.id == Test_bot_application_ID:
        ctx = await bot.get_context(message)
        await bot.invoke(ctx)

    if message.author == bot.user:
        return

    if profanity.check_profanity(message.content):
        await message.channel.send(message.author.name + ' says: ' +
            profanity.censor_profanity(message.content))
        await message.delete()

    await bot.process_commands(message)

    if message.content == 'hey bot':
        response = 'hey yourself ;)'
        await message.channel.send(response)
 run on message sent to a channel 
run on message sent to a channel
run on message sent to a channel
async def on_message(message):
    if message.author.bot and message.author.id == Test_bot_application_ID:
        ctx = await bot.get_context(message)
        await bot.invoke(ctx)
    if message.author == bot.user:
        return
    if profanity.check_profanity(message.content):
        await message.channel.send(message.author.name + ' says: ' +
            profanity.censor_profanity(message.content))
        await message.delete()
    await bot.process_commands(message)
    if message.content == 'hey bot':
        response = 'hey yourself ;)'
        await message.channel.send(response)
async def on_message ( message ) : if message . author . bot and message . author . id == Test_bot_application_ID : ctx = await bot . get_context ( message ) await bot . invoke ( ctx ) if message . author == bot . user : return if profanity . check_profanity ( message . content ) : await message . channel . send ( message . author . name + ' says: ' + profanity . censor_profanity ( message . content ) ) await message . delete ( ) await bot . process_commands ( message ) if message . content == 'hey bot' : response = 'hey yourself ;)' await message . channel . send ( response )
run on message sent to a channel
run on message sent to a channel
''' run on message sent to a channel ''' # allow messages from test bot

message