devOS-Sanity-Edition / TeaBridge

A simple survival friendly MC -> Discord chat bridge
MIT License
6 stars 0 forks source link

PluralKit Support #7

Closed Oliver-makes-code closed 1 year ago

Oliver-makes-code commented 1 year ago

It'd be neat if there was PluralKit support. You can detect messages sent by PluralKit and relay them to Minecraft using PlruralKit's API (Documentation found here: https://pluralkit.me/api/)

maximumpower55 commented 1 year ago

I will look into this for v1.1.0

maximumpower55 commented 1 year ago

@Oliver-makes-code I have been able to make it so messages from PK webhooks are actually sent, but I haven't figured out how to not send the messages that are about to be proxied

Oliver-makes-code commented 1 year ago

You can make a lookup to PK's API with the old message id and it'll return a valid message object if it was proxied

maximumpower55 commented 1 year ago

You can make a lookup to PK's API with the old message id and it'll return a valid message object if it was proxied

The problem is the MessageReceivedEvent is invoked before the message is proxied

maximumpower55 commented 1 year ago

The only way I know of fixing this is somehow delaying the event until the message is proxied, and that's jank since that will add delay to normal messages

maximumpower55 commented 1 year ago

Forgot to close this earlier, this is now done.