omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Noxive

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 1
    • Controversial 0
    • Groups 0

    Noxive

    @Noxive

    1
    Reputation
    414
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Noxive Unfollow Follow

    Best posts made by Noxive

    • RE: Discord.py 1.2.2 Bot doesn't respond to commands

      Ok finally solved it. I missed this fragment in the docs:

      Overriding the default provided on_message forbids any extra commands from running. To fix this, add a bot.process_commands(message) line at the end of your on_message
      

      Thanks everyone for help.

      posted in Pythonista
      Noxive
      Noxive

    Latest posts made by Noxive

    • RE: Discord.py 1.2.2 Bot doesn't respond to commands

      Ok finally solved it. I missed this fragment in the docs:

      Overriding the default provided on_message forbids any extra commands from running. To fix this, add a bot.process_commands(message) line at the end of your on_message
      

      Thanks everyone for help.

      posted in Pythonista
      Noxive
      Noxive
    • RE: Discord.py 1.2.2 Bot doesn't respond to commands

      @JonB Tried the function, nothing no response not on the server or the terminal

      @bot.command()
      async def test(ctx):
          print("test Called")
          await ctx.send('test')
      

      I changed the client.event to bot.event, the on_message event and on_ready work fine. The command still doesn't respond

      import discord
      from discord.ext.commands import Bot
      
      TOKEN = 'MyToken'
      
      bot = Bot(command_prefix='$')
      
      
      @bot.command()
      async def test(ctx):
          print("test Called")
          await ctx.send('test')
      
      
      @bot.event
      async def on_ready():
          print("We have logged in as: {0.user}".format(bot))
      
      
      @bot.event
      async def on_message(message):
      
          if message.author == bot.user:
              return
      
          if message.content.startswith("shrug"):
              print("shrug")
              await message.channel.send('¯\_(ツ)_/¯')
      
      bot.run(TOKEN)
      posted in Pythonista
      Noxive
      Noxive
    • RE: Discord.py 1.2.2 Bot doesn't respond to commands

      @ellie_ff1493 I did. Nothing happens. Like the command event never even occured.

      @ccc @cvp I deleted all the comments and PyDoc, there is no change.

      posted in Pythonista
      Noxive
      Noxive
    • Discord.py 1.2.2 Bot doesn't respond to commands

      Ok, so I'm trying to create Discord Bot and i can't figure out why my commands don't work. The on_message() events work properly if i type shrug the bot sends the emoji but when i try to call the $test command bot doesn't respond literraly no errors and no response on the channel. I've spent like 2 hours reading the documentation and everything is ok, but its not.

      Python 3.6.8
      discord-py 1.2.2

      Please somebody help.

      from discord.ext.commands import Bot
      
      TOKEN = 'Here goes my token'
      
      client = discord.Client()
      bot = Bot(command_prefix='$') """ Command prefix is marked red in PyCharm"""
      
      
      @bot.command()
      async def test(ctx, arg):
          await ctx.send(arg)
      
      """
      After the bot logging on to the server 
      on_ready event occurs and prints the name of the logged in Bot
      """
      
      
      @client.event
      async def on_ready():
          print("We have logged in as: {0.user}".format(client))
      
      """
      When the message is sent event on_message() occurs
      """
      
      
      @client.event
      async def on_message(message):
      
          """
          If the message is from the bot nothing happens.
          ...
          When the user inputs $hello bot sends Hello! message on the channel.
          ...
          For the message = 'shrug' bot sends shrug emoji in ASCII onto the channel.
          """
      
          if message.author == client.user:
              return
      
          if message.content.startswith('$hello'):
              await message.channel.send("Hello!")
      
          if message.content.startswith("shrug"):
              await message.channel.send('¯\_(ツ)_/¯')
      
      client.run(TOKEN)
      
      
      posted in Pythonista
      Noxive
      Noxive