Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Last active July 5, 2024 02:11
Show Gist options
  • Select an option

  • Save ruanbekker/dd948c054b6648945104f9a74e9b499a to your computer and use it in GitHub Desktop.

Select an option

Save ruanbekker/dd948c054b6648945104f9a74e9b499a to your computer and use it in GitHub Desktop.

Revisions

  1. ruanbekker revised this gist Jun 27, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion use_curl_to_send_discord_messages.md
    Original file line number Diff line number Diff line change
    @@ -15,5 +15,7 @@ Get the channel id:
    Make a request:

    ```bash
    curl -H "Authorization: Bot $DISCORD_TOKEN" -H "Content-Type: application/json" -XPOST "https://discordapp.com/api/channels/$CHANNEL_ID/messages" -d '{"content": "hi"}'
    curl -H "Authorization: Bot $DISCORD_TOKEN" \
    -H "Content-Type: application/json" \
    -XPOST "https://discordapp.com/api/channels/$CHANNEL_ID/messages" -d '{"content": "hi"}'
    ```
  2. ruanbekker created this gist Jun 27, 2022.
    19 changes: 19 additions & 0 deletions use_curl_to_send_discord_messages.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    This blog post shows how to create a token:
    - https://blog.ruanbekker.com/blog/2022/05/05/create-a-discord-bot-in-python/

    Enable developer mode:

    1. User Settings
    2. Advanced
    3. Enable Developer Mode

    Get the channel id:

    1. Right click on a channel
    2. Select "copy id"

    Make a request:

    ```bash
    curl -H "Authorization: Bot $DISCORD_TOKEN" -H "Content-Type: application/json" -XPOST "https://discordapp.com/api/channels/$CHANNEL_ID/messages" -d '{"content": "hi"}'
    ```