forked from MagicBane/Server
MagicBot
2 years ago
7 changed files with 6 additions and 328 deletions
@ -1,55 +0,0 @@
@@ -1,55 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package discord.handlers; |
||||
|
||||
import discord.MagicBot; |
||||
import discord.RobotSpeak; |
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; |
||||
import org.pmw.tinylog.Logger; |
||||
|
||||
import static discord.ChatChannel.ANNOUNCE; |
||||
|
||||
public class AnnounceChannelHandler { |
||||
|
||||
public static void handleRequest(MessageReceivedEvent event, String[] args) { |
||||
|
||||
String chatText; |
||||
String outString; |
||||
|
||||
// Early exit if database unavailable or is not an admin
|
||||
|
||||
if (MagicBot.isAdminEvent(event) == false) |
||||
return; |
||||
|
||||
// Nothing to send?
|
||||
|
||||
if (args.length == 0) |
||||
return; |
||||
|
||||
// Convert argument array into string;
|
||||
|
||||
chatText = String.join(" ", args); |
||||
|
||||
// Build String
|
||||
|
||||
if (chatText.startsWith("-r ")) |
||||
outString = |
||||
"```\n" + "Hello Players \n\n" + |
||||
chatText.substring(3) + "\n\n" + |
||||
RobotSpeak.getRobotSpeak() + "\n```"; |
||||
else outString = chatText; |
||||
|
||||
// Write string to announce channel
|
||||
|
||||
if (ANNOUNCE.textChannel.canTalk()) |
||||
ANNOUNCE.textChannel.sendMessage(outString).queue(); |
||||
|
||||
Logger.info(event.getAuthor().getName() + " announce: " + chatText); |
||||
} |
||||
} |
@ -1,44 +0,0 @@
@@ -1,44 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package discord.handlers; |
||||
|
||||
import discord.MagicBot; |
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; |
||||
import org.pmw.tinylog.Logger; |
||||
|
||||
import static discord.ChatChannel.CHANGELOG; |
||||
|
||||
public class ChangeLogHandler { |
||||
|
||||
public static void handleRequest(MessageReceivedEvent event, String[] args) { |
||||
|
||||
String outString; |
||||
|
||||
// Early exit if database unavailable or is not an admin
|
||||
|
||||
if (MagicBot.isAdminEvent(event) == false) |
||||
return; |
||||
|
||||
// Nothing to send?
|
||||
|
||||
if (args.length == 0) |
||||
return; |
||||
|
||||
// Convert argument array into string;
|
||||
|
||||
outString = String.join(" ", args); |
||||
|
||||
// Write string to changelog channel
|
||||
|
||||
if (CHANGELOG.textChannel.canTalk()) |
||||
CHANGELOG.textChannel.sendMessage(outString).queue(); |
||||
|
||||
Logger.info(event.getAuthor().getName() + " changelog entry: " + outString); |
||||
} |
||||
} |
@ -1,56 +0,0 @@
@@ -1,56 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package discord.handlers; |
||||
|
||||
import discord.MagicBot; |
||||
import discord.RobotSpeak; |
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; |
||||
import org.pmw.tinylog.Logger; |
||||
|
||||
import static discord.ChatChannel.FORTOFIX; |
||||
|
||||
public class ForToFixChannelHandler { |
||||
|
||||
public static void handleRequest(MessageReceivedEvent event, String[] args) { |
||||
|
||||
String chatText; |
||||
String outString; |
||||
|
||||
// Early exit if database unavailable or is not an admin
|
||||
|
||||
if (MagicBot.isAdminEvent(event) == false) |
||||
return; |
||||
|
||||
// Nothing to send?
|
||||
|
||||
if (args.length == 0) |
||||
return; |
||||
|
||||
// Convert argument array into string;
|
||||
|
||||
chatText = String.join(" ", args); |
||||
|
||||
// Build String
|
||||
|
||||
if (chatText.startsWith("-r ")) |
||||
outString = |
||||
"```\n" + "Hello Players \n\n" + |
||||
chatText.substring(3) + "\n\n" + |
||||
RobotSpeak.getRobotSpeak() + "\n```"; |
||||
else outString = chatText; |
||||
|
||||
// Write string to changelog channel
|
||||
|
||||
if (FORTOFIX.textChannel.canTalk()) |
||||
FORTOFIX.textChannel.sendMessage(outString).queue(); |
||||
|
||||
Logger.info(event.getAuthor().getName() + "fortofix: " + chatText); |
||||
|
||||
} |
||||
} |
@ -1,56 +0,0 @@
@@ -1,56 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package discord.handlers; |
||||
|
||||
import discord.MagicBot; |
||||
import discord.RobotSpeak; |
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; |
||||
import org.pmw.tinylog.Logger; |
||||
|
||||
import static discord.ChatChannel.GENERAL; |
||||
|
||||
public class GeneralChannelHandler { |
||||
|
||||
public static void handleRequest(MessageReceivedEvent event, String[] args) { |
||||
|
||||
String chatText; |
||||
String outString; |
||||
|
||||
// Early exit if database unavailable or is not an admin
|
||||
|
||||
if (MagicBot.isAdminEvent(event) == false) |
||||
return; |
||||
|
||||
// Nothing to send?
|
||||
|
||||
if (args.length == 0) |
||||
return; |
||||
|
||||
// Convert argument array into string;
|
||||
|
||||
chatText = String.join(" ", args); |
||||
|
||||
// Build String
|
||||
|
||||
if (chatText.startsWith("-r ")) |
||||
outString = |
||||
"```\n" + "Hello Players \n\n" + |
||||
chatText.substring(3) + "\n\n" + |
||||
RobotSpeak.getRobotSpeak() + "\n```"; |
||||
else outString = chatText; |
||||
|
||||
// Write string to changelog channel
|
||||
|
||||
if (GENERAL.textChannel.canTalk()) |
||||
GENERAL.textChannel.sendMessage(outString).queue(); |
||||
|
||||
Logger.info(event.getAuthor().getName() + "general: " + chatText); |
||||
|
||||
} |
||||
} |
@ -1,55 +0,0 @@
@@ -1,55 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package discord.handlers; |
||||
|
||||
import discord.MagicBot; |
||||
import discord.RobotSpeak; |
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; |
||||
import org.pmw.tinylog.Logger; |
||||
|
||||
import static discord.ChatChannel.POLITICAL; |
||||
|
||||
public class PoliticalChannelHandler { |
||||
|
||||
public static void handleRequest(MessageReceivedEvent event, String[] args) { |
||||
|
||||
String chatText; |
||||
String outString; |
||||
|
||||
// Early exit if database unavailable or is not an admin
|
||||
|
||||
if (MagicBot.isAdminEvent(event) == false) |
||||
return; |
||||
|
||||
// Nothing to send?
|
||||
|
||||
if (args.length == 0) |
||||
return; |
||||
|
||||
// Convert argument array into string;
|
||||
|
||||
chatText = String.join(" ", args); |
||||
|
||||
// Build String
|
||||
|
||||
if (chatText.startsWith("-r ")) |
||||
outString = |
||||
"```\n" + "Hello Players \n\n" + |
||||
chatText.substring(3) + "\n\n" + |
||||
RobotSpeak.getRobotSpeak() + "\n```"; |
||||
else outString = chatText; |
||||
|
||||
// Write string to changelog channel
|
||||
|
||||
if (POLITICAL.textChannel.canTalk()) |
||||
POLITICAL.textChannel.sendMessage(outString).queue(); |
||||
|
||||
Logger.info(event.getAuthor().getName() + " politics: " + chatText); |
||||
} |
||||
} |
@ -1,56 +0,0 @@
@@ -1,56 +0,0 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
package discord.handlers; |
||||
|
||||
import discord.MagicBot; |
||||
import discord.RobotSpeak; |
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; |
||||
import org.pmw.tinylog.Logger; |
||||
|
||||
import static discord.ChatChannel.RECRUIT; |
||||
|
||||
public class RecruitChannelHandler { |
||||
|
||||
public static void handleRequest(MessageReceivedEvent event, String[] args) { |
||||
|
||||
String chatText; |
||||
String outString; |
||||
|
||||
// Early exit if database unavailable or is not an admin
|
||||
|
||||
if (MagicBot.isAdminEvent(event) == false) |
||||
return; |
||||
|
||||
// Nothing to send?
|
||||
|
||||
if (args.length == 0) |
||||
return; |
||||
|
||||
// Convert argument array into string;
|
||||
|
||||
chatText = String.join(" ", args); |
||||
|
||||
// Build String
|
||||
|
||||
if (chatText.startsWith("-r ")) |
||||
outString = |
||||
"```\n" + "Hello Players \n\n" + |
||||
chatText.substring(3) + "\n\n" + |
||||
RobotSpeak.getRobotSpeak() + "\n```"; |
||||
else outString = chatText; |
||||
|
||||
// Write string to changelog channel
|
||||
|
||||
if (RECRUIT.textChannel.canTalk()) |
||||
RECRUIT.textChannel.sendMessage(outString).queue(); |
||||
|
||||
Logger.info(event.getAuthor().getName() + "recruit: " + chatText); |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue