-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.2.1: Added Stringbuilder to Console to Discord so large error messa…
…ges will get send in one message instead of many messages
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package de.tamion.others; | ||
|
||
import de.tamion.discord.DCMain; | ||
import de.tamion.minecraft.MCMain; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.bukkit.scheduler.BukkitScheduler; | ||
|
||
public class ConsoleBuilder { | ||
|
||
public static StringBuilder sb = new StringBuilder(); | ||
public static void consolescheduler() { | ||
FileConfiguration config = MCMain.getPlugin().getConfig(); | ||
BukkitScheduler scheduler = Bukkit.getScheduler(); | ||
scheduler.runTaskTimer(MCMain.getPlugin(), () -> { | ||
if(sb.length() != 0) { | ||
DCMain.jda.getGuildById(config.getString("Bot.guildid")).getTextChannelById(config.getString("Bot.consoleid")).sendMessage(sb.toString()).queue(); | ||
sb.setLength(0); | ||
} | ||
},20L ,20L); | ||
} | ||
} |