[PR #912] [CLOSED] Discord handler #1411

Closed
opened 2026-03-04 03:12:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/912
Author: @Crecket
Created: 1/9/2017
Status: Closed

Base: masterHead: master


📝 Commits (3)

  • 3cde5d9 discord bot handler and test added
  • ad1857f fixed annotations
  • 614c387 get error level from record

📊 Changes

2 files changed (+176 additions, -0 deletions)

View changed files

src/Monolog/Handler/DiscordBotHandler.php (+128 -0)
tests/Monolog/Handler/DiscordBotHandlerTest.php (+48 -0)

📄 Description

A basic discord handler using the Bot api over HTTPS which can be found here: https://discordapp.com/developers/docs/reference

A quick example:

$discordHandler = new \Monolog\Handler\DiscordBotHandler($channel_id, $bot_token, Logger::ERROR);
$discordHandler->setEmoji(':warning:');
$monolog->pushHandler($discordHandler);

$monolog->error('Wew something went terribly wrong!');

This will output something similar to this:
56d5896d8e96e32dcd98735df826976c


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/912 **Author:** [@Crecket](https://github.com/Crecket) **Created:** 1/9/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`3cde5d9`](https://github.com/Seldaek/monolog/commit/3cde5d9640e8a0fb71291691a89629118e5c8a74) discord bot handler and test added - [`ad1857f`](https://github.com/Seldaek/monolog/commit/ad1857f0674d6b9a293457ec57d77ed6c40b8091) fixed annotations - [`614c387`](https://github.com/Seldaek/monolog/commit/614c387d9a7fad3dc48d5bfdae2dae2a5b3fd0b2) get error level from record ### 📊 Changes **2 files changed** (+176 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/Monolog/Handler/DiscordBotHandler.php` (+128 -0) ➕ `tests/Monolog/Handler/DiscordBotHandlerTest.php` (+48 -0) </details> ### 📄 Description A basic discord handler using the Bot api over HTTPS which can be found here: https://discordapp.com/developers/docs/reference A quick example: ```PHP $discordHandler = new \Monolog\Handler\DiscordBotHandler($channel_id, $bot_token, Logger::ERROR); $discordHandler->setEmoji(':warning:'); $monolog->pushHandler($discordHandler); $monolog->error('Wew something went terribly wrong!'); ``` This will output something similar to this: ![56d5896d8e96e32dcd98735df826976c](https://cloud.githubusercontent.com/assets/7481136/21787831/b1a7d532-d6cb-11e6-98db-e37dd93b078a.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:12:30 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#1411
No description provided.