I feel like Discord with webhooks would make a good plugin

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

I feel like Discord with webhooks would make a good plugin

Post by ToxMox » Fri Aug 04, 2017 7:45 pm

I'm currently using IFTTT to Autoremote via webhooks URL and it is cumbersome to setup and was working for me until yesterday. I feel like Discord would be a great way to send Events to Eventghost but I have no idea how to go about implementing this.
https://support.discordapp.com/hc/en-us ... o-Webhooks

So then if we had a plugin for Eventghost that could read messages posted to a channel it would be a great thing no?
Maybe someone will like this idea and run with it :)

User avatar
kgschlosser
Site Admin
Posts: 3030
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: I feel like Discord with webhooks would make a good plug

Post by kgschlosser » Sat Aug 05, 2017 3:00 am

I am not entirely 100% sure of how you would want to apply this but it seems to be targeted at hooking websites.

and unfortunatly not so simple... you have to do a lot of JSON parsing and HTTP POST parsing

These lines are stated right on their main page
"If you've got a knack for JSON application-building or HTTP POST requests"
"programming-inclined users can make their own tube "

the problem is from a maintenance standpoint it's a nightmare. it basically rides on the API of a website never changing. if it does the code will have to be changed..also because each website is different a whole code block would have to be written for specific web pages.
If you like the work I have been doing then feel free to Image

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: I feel like Discord with webhooks would make a good plug

Post by ToxMox » Sun Aug 06, 2017 3:06 pm

Perhaps I didn't explain properly. The JSON side of things is trivial. Here is something I did in about 15 seconds. Just showing a screenshot of the webhook url generating a message in the discord channel
http://i.imgur.com/B4GKbzH.png

I was basically proposing if we had a plugin that would login and watch a Discord channel for messages and simply convert them to events in Eventghost.

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: I feel like Discord with webhooks would make a good plug

Post by ToxMox » Sun Aug 06, 2017 6:10 pm

Ok so I got this working using Discord.js which is a Node Discord api/bot running on my EG machine. Sending message to my server channel using the Discord Webhook via IFTTT then the bot relays the message into a local URL on my machine which is captured by the EG webserver plugin.
If anyone is interested I can do a writeup on how I did this. I still feel like it would be cool to actually have an EG plugin to watch the Discord channel but I'm happy with how this is working and it is really fast.

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: I feel like Discord with webhooks would make a good plug

Post by ToxMox » Sun Aug 06, 2017 8:22 pm

Also here's a good Discord python API https://github.com/Rapptz/discord.py

User avatar
Pako
Plugin Developer
Posts: 2275
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: I feel like Discord with webhooks would make a good plug

Post by Pako » Tue Aug 08, 2017 9:18 am

ToxMox wrote:I'm currently using IFTTT to Autoremote via webhooks URL and it is cumbersome to setup ...
I use IFTTT + Webhooks + Pushbullet to invoke event in EventGhost. The setting is very straightforward and it works very reliably.
Have you considered this alternative?

Pako
You know flattr ? You can Image

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: I feel like Discord with webhooks would make a good plug

Post by ToxMox » Tue Aug 08, 2017 1:34 pm

Pako wrote:
ToxMox wrote:I'm currently using IFTTT to Autoremote via webhooks URL and it is cumbersome to setup ...
I use IFTTT + Webhooks + Pushbullet to invoke event in EventGhost. The setting is very straightforward and it works very reliably.
Have you considered this alternative?

Pako
Hi Pako,

I originally saw your plugin but had decided not to use it because I misunderstood how their premium model works and thought they limited how many messages could be sent with the free one. Anyway I just tried your plugin and can't get it to work. I even did a clean install of EG 0.4.1.r1722 on another PC. Removed the lib26 websocket folder. Copied over the websocket folder from your zip. Unzipped your zip into the plugins folder. Copied the init py file into the pushbullet folder. Start EG. Enable the pushbullet plugin. Add my api key and set debug logging to 5, hit ok. Am I supposed to see a device in my pushbullet account with the nickname specified in the plugin because I don't. Also nothing is showing in the EG log regarding the plugin other than the initial startup entry. I send pushes from IFTTT and just nothing at all happens. No log nothing.

User avatar
Pako
Plugin Developer
Posts: 2275
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: I feel like Discord with webhooks would make a good plug

Post by Pako » Tue Aug 08, 2017 4:24 pm

Pako wrote:I originally saw your plugin but had decided not to use it because I misunderstood how their premium model works ...
I only have a free account and I have never encountered any restrictions.
Pako wrote:Anyway I just tried your plugin and can't get it to work.
I have no idea why it does not work. Chrome extension or desktop application Pushbullet works normally?

Pako
You know flattr ? You can Image

piert
Experienced User
Posts: 260
Joined: Tue Jun 14, 2011 2:53 pm

Re: I feel like Discord with webhooks would make a good plug

Post by piert » Tue Aug 08, 2017 6:40 pm

I think you do need to add a device to your PB account somehow.

Note that the free account has a limit of 500 push notifications per month.

ToxMox
Posts: 14
Joined: Fri Aug 04, 2017 7:39 pm

Re: I feel like Discord with webhooks would make a good plug

Post by ToxMox » Wed Aug 09, 2017 1:13 pm

Pako wrote:
Pako wrote:I originally saw your plugin but had decided not to use it because I misunderstood how their premium model works ...
I only have a free account and I have never encountered any restrictions.
Pako wrote:Anyway I just tried your plugin and can't get it to work.
I have no idea why it does not work. Chrome extension or desktop application Pushbullet works normally?

Pako
Yes the desktop app works fine. I've moved to the MQTT plugin and using beebotte.com as the MQTT broker because it has REST support which works great with IFTTT. The free plan is plenty with 1.5 million requests per month and the speed is very fast so far.

Post Reply