Skip to content

Instantly share code, notes, and snippets.

@scragly
Created October 28, 2018 03:27
Show Gist options
  • Select an option

  • Save scragly/bbc8982bc3ea11a6c81c8dcc631c89a2 to your computer and use it in GitHub Desktop.

Select an option

Save scragly/bbc8982bc3ea11a6c81c8dcc631c89a2 to your computer and use it in GitHub Desktop.

Revisions

  1. scragly created this gist Oct 28, 2018.
    8 changes: 8 additions & 0 deletions local_embed.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    ```py
    f = discord.File("some_file_path", filename="image.png")
    e = discord.Embed()
    e.set_image(url="attachment://image.png")
    await messagable.send(file=f, embed=e)
    ```

    This allows you to use a local image located with the bots files, instead of uploading first and then specifying that uploaded image's url.