Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add notifier for external plugins #666

Merged
merged 32 commits into from
Mar 2, 2025

Conversation

iProdigy
Copy link
Member

Closes #665

@iProdigy iProdigy marked this pull request as draft February 27, 2025 23:37
@Mm2PL Mm2PL self-requested a review February 27, 2025 23:41
@iProdigy iProdigy marked this pull request as ready for review February 28, 2025 04:16
Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great, great PR number too 😈 - just some questions on the API

@iProdigy
Copy link
Member Author

sample notif

image

@adamk33n3r
Copy link

great PR number too 😈

I thought about this too haha. Looking forward to this. Will be cool!

@iProdigy iProdigy requested a review from pajlada February 28, 2025 20:43
@iProdigy iProdigy marked this pull request as draft February 28, 2025 21:09
@iProdigy iProdigy marked this pull request as ready for review February 28, 2025 21:29
@iProdigy
Copy link
Member Author

iProdigy commented Mar 1, 2025

using latest icon
image

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the mini nits, this looks good to me 👍

@iProdigy iProdigy marked this pull request as draft March 1, 2025 20:18
@iProdigy iProdigy force-pushed the feature/external-plugin-notifier branch from 2838c6d to 2bbd197 Compare March 1, 2025 22:31
@iProdigy iProdigy force-pushed the feature/external-plugin-notifier branch from 2bbd197 to 63e9885 Compare March 1, 2025 22:31
@iProdigy iProdigy marked this pull request as ready for review March 1, 2025 22:39
@iProdigy iProdigy requested review from pajlada and Mm2PL March 1, 2025 22:39
Copy link
Member

@Mm2PL Mm2PL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works via the RuneLite Shell from debug mode.

import net.runelite.client.eventbus.EventBus;
var eventBus = inject(EventBus.class);

log.info("Hello {}", client.getGameState());

Map<String, Object> data = new HashMap<>();
data.put("sourcePlugin", "RuneLite Shell");
data.put("text", "This is the primary content within the webhook. %USERNAME% will automatically be replaced with the player name and you can define your own template replacements like %XYZ%");
data.put("replacements", Map.of());
//Map.of("%XYZ%", AReplacement.ofText("sample replacement")));
data.put("title", "An optional embed title for your notification");
data.put("imageRequested", true);
data.put("fields", List.of());
data.put("metadata", Map.of("custom key", "custom value"));
data.put("urls", null);
//data.put("urls", Arrays.asList(okhttp3.HttpUrl.parse("http://localhost:3000/dink")));
PluginMessage dinkRequest = new PluginMessage("dink", "notify", data);

eventBus.post(dinkRequest);

Just a question

@iProdigy iProdigy marked this pull request as draft March 2, 2025 02:21
@iProdigy iProdigy marked this pull request as ready for review March 2, 2025 03:06
@iProdigy iProdigy requested review from pajlada and Mm2PL March 2, 2025 03:06
@iProdigy iProdigy merged commit 2ec5f6e into pajlads:master Mar 2, 2025
4 checks passed
@iProdigy iProdigy deleted the feature/external-plugin-notifier branch March 6, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support a PluginMessage event to send notifications
5 participants