Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
479 B
3
Indexable
Never
async def on_message(message):
    if message.author == client.user:
        return

    if message.content.startswith('!dictionary'):
        word = message.content.split(' ')[1]
        definition = dictionary.meaning(word)
        if definition:
            for key, val in definition.items():
                await message.channel.send(f'**{key}**: {", ".join(val)}')
        else:
            await message.channel.send('Sorry, I could not find a definition for that word.')
Leave a Comment