Added removing obfuscated chars from names, delivered reactions are more reliable, added linking to the PR on plugin autoupdate, a fix #24
1 changed files with 11 additions and 2 deletions
|
@ -110,7 +110,7 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
|
|||
"Sorry, you need to be online on the server and have your accounts connected, you can only access these commands:\n"
|
||||
+ Arrays.stream(UnconnectedCmds).map(uc -> "/" + uc)
|
||||
.collect(Collectors.joining(", "))
|
||||
+ "\nTo connect your accounts, use @ChromaBot connect here or in "
|
||||
+ "\nTo connect your accounts, use @ChromaBot connect in "
|
||||
+ DiscordPlugin.botchannel.mention());
|
||||
return;
|
||||
}
|
||||
|
@ -120,7 +120,6 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
|
|||
dmessage + (event.getMessage().getAttachments().size() > 0 ? "\n" + event.getMessage()
|
||||
.getAttachments().stream().map(a -> a.getUrl()).collect(Collectors.joining("\n"))
|
||||
: ""));
|
||||
event.getMessage().addReaction(DiscordPlugin.DELIVERED_REACTION);
|
||||
event.getMessage().getChannel().getMessages().stream().forEach(m -> {
|
||||
try {
|
||||
final IReaction reaction = m.getReactionByName(DiscordPlugin.DELIVERED_REACTION);
|
||||
|
@ -139,6 +138,16 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
|
|||
TBMCCoreAPI.SendException("An error occured while removing reactions from chat!", e);
|
||||
}
|
||||
});
|
||||
while (true)
|
||||
try {
|
||||
event.getMessage().addReaction(DiscordPlugin.DELIVERED_REACTION);
|
||||
break;
|
||||
} catch (RateLimitException e) {
|
||||
if (e.getRetryDelay() > 0)
|
||||
Thread.sleep(e.getRetryDelay());
|
||||
else
|
||||
Thread.sleep(100);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TBMCCoreAPI.SendException("An error occured while handling message \"" + dmessage + "\"!", e);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue