-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: add notifier for external plugins #666
Conversation
There was a problem hiding this 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
I thought about this too haha. Looking forward to this. Will be cool! |
There was a problem hiding this 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 👍
Co-authored-by: pajlada <[email protected]>
2838c6d
to
2bbd197
Compare
2bbd197
to
63e9885
Compare
There was a problem hiding this 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
Closes #665