MyBB Community Forums

Full Version: [DEV] Send information about new posts and threads to Discord channel using WebHooks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
Alright sweet, I'd be more than happy to be your test subject lol, when ya' get around to working on it!
I've been working on multiple instances of the plugin. Unfortunately. it's not possible to do it automatically, BUT! I've made a workaround.

If you want to have multiple instances of this plugin you have to:
1. Move all files from 'inc' to your mybb 'inc' folder as always
2. Copy file discord_webhooks{suffix}.php to your mybb's inc/plugins folder
3. Replace {suffix} that filename to your suffix code (for example: _test1, so the filename should looks like discord_webhooks_test1.php)
4. Edit that file, find and replace all {suffix} text to string you have replaced the filename (eg. {suffix} => _test1}
Now you have another instance of discord plugin Smile

IMPORTANT! You HAVE TO use only alphanumeric or underscore characters for suffix as it's contained into the function names. Suffix shouldn't contain special characters, punctuations characters, whitespaces, etc.!

//Edit: Of course I'll update multiinstance code always when normal code will be updated. I'll work on other issues on a sunday evening
Awesome! Ill give this a try tonight when I get back to my computer
I can't seem to get this to work. Is it because forum urls end with .html? So I am wondering if it is because search engine friendly urls are enabled? so this showthread.php?tid=1 becomes thread-1.html.

Thanks
Yes, it's because of friendly URLs. I do not have as much time as I would like to because of work. It should be fixed in the first days of december Smile
(2017-11-24, 02:09 AM)ryczypior Wrote: [ -> ]Yes, it's because of friendly URLs. I do not have as much time as I would like to because of work. It should be fixed in the first days of december Smile

I could edit the code but wasn't sure if I could easily. I suppose I can turn off friendly urls.

How long does it normally take to post? Or is it pretty fast? I turned off friendly urls and still not working.
Can't wait for you to fix it for friendly urls. Great work on this! ty
Does this require the pluginlibrary?
After a while of using this, I've yet to come across any problems, so +1 for that!

There's really only one thing that I can think of that would make this webhook plugin complete.

And that would be a way to add embeds in the messages, instead of just the default text message.

With embeds, we'd be able to make the notifications look quite a bit more appealing, such as something along these lines:

[Image: dbIT0jr.png]

Something that could pull the posters avatar URL, and either the site's favicon or a custom image, would definitely be nice, in my personal opinion.



EDIT. Well, I have experienced one problem haha. When I get post notifications, the URLs don't work for some reason. 



#2nd EDIT.

Fixed the problem, for some reason, under "static public function newThread($entry)" the link showed up fine "$discordWebhook->getFullUrl('/forums/showthread.php?tid='" but under "static public function newPost($entry)" the link showed up wrong "$discordWebhook->getFullUrl('/showthread.php?tid='". Don't know if this was just a me-case, or if it's a problem others might run into.
I have same issue. Looking forward, I hope there will be a new release soon Smile
Pages: 1 2 3 4 5 6