General Tech IoT Linux

Making a phone notification tool using Discord Webhooks

Reading Jlelse’s blog here ( I realised there is another alternative to using an automation tool like IFTTT or Microsoft Power Automate, is to use a messaging app like Discord or Telegram. Previous post on the same topic:

Creating the Discord Notification Webhook

To make a personal notifier using discord you will need to make your own empty server for just you:

  • Make a server
  • Go to the #general channel settings
  • Go to Webhooks section and create a webhook:
  • Copy the URL, and use this in your script

A Shell Script to send a notification

Note that this script uses the tools curl and jq so they will need to be installed for it to work:


curl --header 'Content-Type: application/json' --data "$(echo $1 | jq --raw-input '{"content": .}')" ''

A Python3 example using requests library


import json
import requests
import sys

if len(sys.argv) < 2:
    print('need to provide an argument')

message = ' '.join(sys.argv[1:])
url = ''
data = json.dumps({"content": message}), headers={'Content-Type': 'application/json'}, data=data)

Other examples can be taken from my previous post on IFTTT, just change the JSON data to use content instead of value:

Leave a Reply

Your email address will not be published. Required fields are marked *