Discord.py Example

    0

    2

    Atakan Kaya

    import discord
    
    client = discord.Client()
    
    @client.event
    async def on_ready():
      print('We have logged in as {0.user}'.format(client))
    
    @client.event
    async def on_message(message):
      if message.author == client.user:
        return
    
      if message.content.startswith('$hello'):
        await message.channel.send('Hello!')
    
    client.run('token')
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.