I help my clients acquire new users and make more money with their web businesses. I have ten years of experience with SaaS projects. If that’s something you need help with, we should get in touch!
< Back to article list

Envoyer une notification discord

Un petit snippet: ca sert de temps en temps d’envoyer des notifications. Voici comment le faire vers discord avec quelques lignes de python − en fait, une simple requête POST sur un webhook.

import requests

# Make a webhook for the channel you want to send things to:
# Server settings -> integrations -> webhook -> new webhook
webhook_url = ""
headers={'Content-Type': 'application/json'}
# Build your embeds with an online embed editor like 
data = {
  "embeds": [
      "title": "⛽ A new blog post",
      "url": "",
      "color": 15258703,
      "fields": [
          "name": ":smile:  Reading time",
          "value": "```yaml\n5 minutes\n```",
          "inline": True
          "name": ":grinning:  Word count",
          "value": "```diff\n1000```",
          "inline": True
      "timestamp": "2022-11-17T00:28:45.000Z"
import json
	r =, headers=headers, json=data)
except Exception as e: