[Solved] DiscordSendMessage / DiscordReceiveMessage events
Gunging opened this issue · 1 comments
So one can make a plugin that parses a character sequence, lets say :thinking:
, into an unused unicode character 㜁
when a player sends a chat. Then make a font texture pack, and magic, players can now use 🤔 in the mc chat.
DiscordSRV will then send the following:
Thus, currently, one must use a very hacky method of running an Async Task that restores the original message (that has :thinking:
instead of 㜁
) before DiscordSRV runs its own Async Task that actually sends the message to the server. The result is the expected:
However, its a bit uncomfortable to resort to this method, plus there is no way to intercept an incoming message to parse into 㜁
So basically:
- DiscordSendMessageEvent that runs right before DiscordSRV sends a message to discord (and one can get/set the message as you would the to the AsyncPlayerChatEvent itself).
- DiscordReceiveMessage that runs right before DiscordSRV broadcasts a message sent from discord (with same get/set functionality as described above).