mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
[+] Done all the requested changes!
This commit is contained in:
parent
b852ea1822
commit
385fc77771
6
pom.xml
6
pom.xml
@ -296,9 +296,9 @@
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<outputFileName>TotalFreedomMod.jar</outputFileName>
|
||||
<compilerVersion>1.8</compilerVersion>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<compilerVersion>11</compilerVersion>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class Discord extends FreedomService
|
||||
public ScheduledThreadPoolExecutor RATELIMIT_EXECUTOR;
|
||||
public List<CompletableFuture<Message>> sentMessages = new ArrayList<>();
|
||||
public Boolean enabled = false;
|
||||
private final Pattern discord_mention_pattern = Pattern.compile("(<@!?([0-9]{16,20})>)");
|
||||
private final Pattern DISCORD_MENTION_PATTERN = Pattern.compile("(<@!?([0-9]{16,20})>)");
|
||||
|
||||
public static String getMD5(String string)
|
||||
{
|
||||
@ -412,11 +412,11 @@ public class Discord extends FreedomService
|
||||
}
|
||||
|
||||
// Patch FS-191 start
|
||||
Matcher mention_matcher = this.discord_mention_pattern.matcher(message);
|
||||
Matcher DISCORD_MENTION_MATCHER = this.DISCORD_MENTION_PATTERN.matcher(message);
|
||||
|
||||
while (mention_matcher.find()) {
|
||||
String mention = mention_matcher.group(1);
|
||||
message = message.replace(mention, "[UserMention-redacted]");
|
||||
while (DISCORD_MENTION_MATCHER.find()) {
|
||||
String mention = DISCORD_MENTION_MATCHER.group(1);
|
||||
message = message.replace(mention, mention.replace('@',' '));
|
||||
}
|
||||
// Patch FS-191 end
|
||||
|
||||
@ -445,6 +445,15 @@ public class Discord extends FreedomService
|
||||
message = StringUtils.remove(message, "§");
|
||||
}
|
||||
|
||||
// Patch FS-191 start
|
||||
Matcher DISCORD_MENTION_MATCHER = this.DISCORD_MENTION_PATTERN.matcher(message);
|
||||
|
||||
while (DISCORD_MENTION_MATCHER.find()) {
|
||||
String mention = DISCORD_MENTION_MATCHER.group(1);
|
||||
message = message.replace(mention, mention.replace('@',' '));
|
||||
}
|
||||
// Patch FS-191 end
|
||||
|
||||
if (enabled && !chat_channel_id.isEmpty())
|
||||
{
|
||||
CompletableFuture<Message> sentMessage = Objects.requireNonNull(bot.getTextChannelById(chat_channel_id)).sendMessage(deformat(message)).submit(true);
|
||||
|
Loading…
Reference in New Issue
Block a user