AIOHTTP meme command discord.py The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceUpload an embed image?Calling an external command in PythonPy2exe tuple index out pf range issue when creating exe filewhen install OSMnx get erroe “UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 24: invalid continuation byte”Tensorflow - 'Unable to get element as bytes' error'NoneType' object has no attribute 'mention' when trying to read from MySQL with Discord.pyImporting tensorflow not working when upgradedDiscord.py Bot Not Leaving Voice ChannelFailed to establish a new connection Discord.pyError give role when a user add reaction Discord.pydiscord bot autorole — in _run_event yield from getattr(self, event)(*args, **kwargs)

How did passengers keep warm on sail ships?

What is the padding with red substance inside of steak packaging?

Single author papers against my advisor's will?

Do warforged have souls?

Would an alien lifeform be able to achieve space travel if lacking in vision?

Do ℕ, mathbbN, BbbN, symbbN effectively differ, and is there a "canonical" specification of the naturals?

1960s short story making fun of James Bond-style spy fiction

Are there continuous functions who are the same in an interval but differ in at least one other point?

Why did Peik Lin say, "I'm not an animal"?

Student Loan from years ago pops up and is taking my salary

Example of compact Riemannian manifold with only one geodesic.

Is every episode of "Where are my Pants?" identical?

What can I do if neighbor is blocking my solar panels intentionally?

US Healthcare consultation for visitors

Mortgage adviser recommends a longer term than necessary combined with overpayments

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Deal with toxic manager when you can't quit

Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time?

60's-70's movie: home appliances revolting against the owners

Why not take a picture of a closer black hole?

Can a flute soloist sit?

Am I ethically obligated to go into work on an off day if the reason is sudden?

Do I have Disadvantage attacking with an off-hand weapon?

What do I do when my TA workload is more than expected?



AIOHTTP meme command discord.py



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
The Ask Question Wizard is Live!
Data science time! April 2019 and salary with experienceUpload an embed image?Calling an external command in PythonPy2exe tuple index out pf range issue when creating exe filewhen install OSMnx get erroe “UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 24: invalid continuation byte”Tensorflow - 'Unable to get element as bytes' error'NoneType' object has no attribute 'mention' when trying to read from MySQL with Discord.pyImporting tensorflow not working when upgradedDiscord.py Bot Not Leaving Voice ChannelFailed to establish a new connection Discord.pyError give role when a user add reaction Discord.pydiscord bot autorole — in _run_event yield from getattr(self, event)(*args, **kwargs)



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I'm making a discord bot and I'm trying to make a random meme command and here's my error and code:



@client.command(pass_context=True)
async def meme(ctx):
embed = discord.Embed(title="meme", description="test")

async with aiohttp.ClientSession() as cs:
async with cs.get('https://www.reddit.com/r/dankmemes/new.json?sort=hot') as r:
res = await r.json()
embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
await client.say(embed=embed)


Ignoring exception in command meme
Traceback (most recent call last):
File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 50, in wrapped
ret = yield from coro(*args, **kwargs)
File "C:UsersatillDownloadsEpic Botserver.py", line 165, in meme
embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
TypeError: set_image() takes 1 positional argument but 2 were given

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandsbot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 374, in invoke
yield from injected(*ctx.args, **ctx.kwargs)
File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 54, in wrapped
raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: set_image() takes 1 positional argument but 2 were given

I'm not sure how to make it so it is in an embed aswell









share|improve this question






























    1















    I'm making a discord bot and I'm trying to make a random meme command and here's my error and code:



    @client.command(pass_context=True)
    async def meme(ctx):
    embed = discord.Embed(title="meme", description="test")

    async with aiohttp.ClientSession() as cs:
    async with cs.get('https://www.reddit.com/r/dankmemes/new.json?sort=hot') as r:
    res = await r.json()
    embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
    await client.say(embed=embed)


    Ignoring exception in command meme
    Traceback (most recent call last):
    File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
    File "C:UsersatillDownloadsEpic Botserver.py", line 165, in meme
    embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
    TypeError: set_image() takes 1 positional argument but 2 were given

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandsbot.py", line 846, in process_commands
    yield from command.invoke(ctx)
    File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
    File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
    discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: set_image() takes 1 positional argument but 2 were given

    I'm not sure how to make it so it is in an embed aswell









    share|improve this question


























      1












      1








      1








      I'm making a discord bot and I'm trying to make a random meme command and here's my error and code:



      @client.command(pass_context=True)
      async def meme(ctx):
      embed = discord.Embed(title="meme", description="test")

      async with aiohttp.ClientSession() as cs:
      async with cs.get('https://www.reddit.com/r/dankmemes/new.json?sort=hot') as r:
      res = await r.json()
      embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
      await client.say(embed=embed)


      Ignoring exception in command meme
      Traceback (most recent call last):
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 50, in wrapped
      ret = yield from coro(*args, **kwargs)
      File "C:UsersatillDownloadsEpic Botserver.py", line 165, in meme
      embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
      TypeError: set_image() takes 1 positional argument but 2 were given

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandsbot.py", line 846, in process_commands
      yield from command.invoke(ctx)
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 374, in invoke
      yield from injected(*ctx.args, **ctx.kwargs)
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 54, in wrapped
      raise CommandInvokeError(e) from e
      discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: set_image() takes 1 positional argument but 2 were given

      I'm not sure how to make it so it is in an embed aswell









      share|improve this question
















      I'm making a discord bot and I'm trying to make a random meme command and here's my error and code:



      @client.command(pass_context=True)
      async def meme(ctx):
      embed = discord.Embed(title="meme", description="test")

      async with aiohttp.ClientSession() as cs:
      async with cs.get('https://www.reddit.com/r/dankmemes/new.json?sort=hot') as r:
      res = await r.json()
      embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
      await client.say(embed=embed)


      Ignoring exception in command meme
      Traceback (most recent call last):
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 50, in wrapped
      ret = yield from coro(*args, **kwargs)
      File "C:UsersatillDownloadsEpic Botserver.py", line 165, in meme
      embed.set_image(res['data']['children'] [random.randint(0, 25)]['data']['url'])
      TypeError: set_image() takes 1 positional argument but 2 were given

      The above exception was the direct cause of the following exception:

      Traceback (most recent call last):
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandsbot.py", line 846, in process_commands
      yield from command.invoke(ctx)
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 374, in invoke
      yield from injected(*ctx.args, **ctx.kwargs)
      File "C:UsersatillAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandscore.py", line 54, in wrapped
      raise CommandInvokeError(e) from e
      discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: set_image() takes 1 positional argument but 2 were given

      I'm not sure how to make it so it is in an embed aswell






      python discord discord.py aiohttp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 12:29









      nkr

      2,75842536




      2,75842536










      asked Mar 8 at 12:24









      ColdLuckColdLuck

      61




      61






















          1 Answer
          1






          active

          oldest

          votes


















          1














          As stated in the error, the function set_image(url) takes only 1 argument, and you gave it 2. And for the embed message look at this thread.






          share|improve this answer


















          • 1





            The important thing to note here is that set_image takes a single positional argument, which is the Embed instance the method is called on. The url should be passed as a keyword argument: embed.set_image(url=...).

            – Patrick Haugh
            Mar 8 at 14:21











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063189%2faiohttp-meme-command-discord-py%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          As stated in the error, the function set_image(url) takes only 1 argument, and you gave it 2. And for the embed message look at this thread.






          share|improve this answer


















          • 1





            The important thing to note here is that set_image takes a single positional argument, which is the Embed instance the method is called on. The url should be passed as a keyword argument: embed.set_image(url=...).

            – Patrick Haugh
            Mar 8 at 14:21















          1














          As stated in the error, the function set_image(url) takes only 1 argument, and you gave it 2. And for the embed message look at this thread.






          share|improve this answer


















          • 1





            The important thing to note here is that set_image takes a single positional argument, which is the Embed instance the method is called on. The url should be passed as a keyword argument: embed.set_image(url=...).

            – Patrick Haugh
            Mar 8 at 14:21













          1












          1








          1







          As stated in the error, the function set_image(url) takes only 1 argument, and you gave it 2. And for the embed message look at this thread.






          share|improve this answer













          As stated in the error, the function set_image(url) takes only 1 argument, and you gave it 2. And for the embed message look at this thread.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 12:32









          AeossaAeossa

          417




          417







          • 1





            The important thing to note here is that set_image takes a single positional argument, which is the Embed instance the method is called on. The url should be passed as a keyword argument: embed.set_image(url=...).

            – Patrick Haugh
            Mar 8 at 14:21












          • 1





            The important thing to note here is that set_image takes a single positional argument, which is the Embed instance the method is called on. The url should be passed as a keyword argument: embed.set_image(url=...).

            – Patrick Haugh
            Mar 8 at 14:21







          1




          1





          The important thing to note here is that set_image takes a single positional argument, which is the Embed instance the method is called on. The url should be passed as a keyword argument: embed.set_image(url=...).

          – Patrick Haugh
          Mar 8 at 14:21





          The important thing to note here is that set_image takes a single positional argument, which is the Embed instance the method is called on. The url should be passed as a keyword argument: embed.set_image(url=...).

          – Patrick Haugh
          Mar 8 at 14:21



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55063189%2faiohttp-meme-command-discord-py%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

          Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

          Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved