question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use Discord embed objects for notification

See original GitHub issue

For the discord notifier the embed-field feature could be used. Below an example of the result: image compared to the current one: image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
devster31commented, Apr 5, 2018

I’m using it mostly for NZBGet. It seems to work fine, I apologize for the delay, didn’t have time to test it before. image

0reactions
caronccommented, Jan 26, 2019

I guess it depends on what the fields are; When i originally created apprise, i focused on what was common across all notification services: all of them had a body; most have a title field, and some allow you to attach images. Anything outside of these 3 fields then become specific to that one service. For example with email you can define the smtp server, or pass in a optional port you wish to use, but that wouldn’t be applicable to say Twitter. so these kind of tweaks are just done by specifying additional options in the url itself.

But with your example (hopefully i understand it correctly), you might have something like:

# Import this library
import apprise

# create an Apprise instance and assign it to variable `apobj`
apobj = apprise.Apprise()

# Add all of the notification services by their server url.
isokay = apobj.add('mailto://myemail:mypass@gmail.com')

# This would fire the notifications to anything added above using add().
# now i'm not sure how your payload/api works but if were to guess:
apobj.notify(
    title=fields.title,
    body=fields.body,
)

Now if you have a lot of extra detail and fields you use in your api, it gets tricky to differentiate what features are available to rich notification services (like Discord, Slack, etc) and ones with very very little features (but work well) like Pushbullet. So if you were to use this tool as a solution and use many specific features of a specific notification service, you may have to massage these fields yourself; effectively simplify them down to title and body unfortunately. ☹️

You can set up custom images with it though; and you can pass in markdown language into it as well and it will support formatting if the notification service supports it.

I’m not sure if i answered your question or not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Embeds | discord.js Guide
To edit the content of an embed you need to pass a new EmbedBuilder structure or embed object to the messages .edit() method....
Read more >
When using a variable inside an embed I get [object Object ...
I am attempting to create a kick command for a bot and its working fine however when the bot logs the embed ......
Read more >
[NEW] YouTube Notification GUIDE || Discord.JS v14
In addition to our How To Make A Discord Bot in Discord.JS v14 series, this video I will be teaching you how to...
Read more >
How To Use Discord Webhooks to Get Notifications for Your ...
In this tutorial, you will send a notification to your webhook when a specific service on your server goes down, and Discord will...
Read more >
Discord Embed Builder - Autocode
A simple, clean interface to help you build embed messages for your Discord bot! Auto-generates a message preview and all the code needed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found