Added command MSB
This commit is contained in:
parent
7cae397244
commit
db5dd58db2
@ -4,21 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
||||
import io.rixa.bot.commands.cmds.admin.ConfigCommand;
|
||||
import io.rixa.bot.commands.cmds.admin.PMCommand;
|
||||
import io.rixa.bot.commands.cmds.general.AdviceCommand;
|
||||
import io.rixa.bot.commands.cmds.general.FeaturesCommand;
|
||||
import io.rixa.bot.commands.cmds.general.HelpCommand;
|
||||
import io.rixa.bot.commands.cmds.general.InfoCommand;
|
||||
import io.rixa.bot.commands.cmds.general.LeaderboardsCommand;
|
||||
import io.rixa.bot.commands.cmds.general.MinecraftCommand;
|
||||
import io.rixa.bot.commands.cmds.general.ModulesCommand;
|
||||
import io.rixa.bot.commands.cmds.general.MusicCommand;
|
||||
import io.rixa.bot.commands.cmds.general.PingCommand;
|
||||
import io.rixa.bot.commands.cmds.general.QuoteCommand;
|
||||
import io.rixa.bot.commands.cmds.general.RankCommand;
|
||||
import io.rixa.bot.commands.cmds.general.RoleMemberList;
|
||||
import io.rixa.bot.commands.cmds.general.ServerInfoCommand;
|
||||
import io.rixa.bot.commands.cmds.general.UrbanDictionaryCommand;
|
||||
import io.rixa.bot.commands.cmds.general.YoutubeCommand;
|
||||
import io.rixa.bot.commands.cmds.general.*;
|
||||
import io.rixa.bot.commands.cmds.moderator.BanCommand;
|
||||
import io.rixa.bot.commands.cmds.moderator.ClearCommand;
|
||||
import io.rixa.bot.commands.cmds.moderator.MuteCommand;
|
||||
@ -103,7 +89,7 @@ public class Rixa {
|
||||
private void loadJDA() {
|
||||
JDABuilder jda = new JDABuilder(AccountType.BOT)
|
||||
.setToken(configuration.getToken())
|
||||
.setGame(Game.of(GameType.WATCHING, configuration.getBotGame()))
|
||||
.setGame(Game.of(GameType.DEFAULT, configuration.getBotGame()))
|
||||
.setEventManager(new AnnotatedEventManager())
|
||||
.addEventListener(new ReadyListener(), new BotJoinListener(), new MessageListener(),
|
||||
new UserListener())
|
||||
@ -155,6 +141,7 @@ public class Rixa {
|
||||
new MusicCommand("music", RixaPermission.NONE, "Listen to music right from discord!",
|
||||
CommandType.USER),
|
||||
new PingCommand("ping", RixaPermission.NONE, "Check Rixa's ping!", CommandType.USER),
|
||||
new MsbCommand("msb", RixaPermission.NONE, "Create a mocking Spongebob meme", CommandType.USER),
|
||||
new ServerInfoCommand("serverinfo", RixaPermission.NONE,
|
||||
"Review information about the server!", CommandType.USER),
|
||||
new QuoteCommand("quote", RixaPermission.NONE,
|
||||
|
@ -0,0 +1,22 @@
|
||||
package io.rixa.bot.commands.cmds.general;
|
||||
|
||||
import io.rixa.bot.commands.Command;
|
||||
import io.rixa.bot.commands.handler.CommandType;
|
||||
import io.rixa.bot.commands.perms.RixaPermission;
|
||||
import io.rixa.bot.utils.MessageFactory;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
|
||||
public class MsbCommand extends Command {
|
||||
|
||||
public MsbCommand(String command, RixaPermission rixaPermission, String description, CommandType commandType) {
|
||||
super(command, rixaPermission, description, commandType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(String commandLabel, Guild guild, Member member, TextChannel channel, String[] args) {
|
||||
String str = String.join("_", args);
|
||||
MessageFactory.create("Mocking Spongebob").setImage("https://mockingspongebob.org/"+str+".jpg").queue(channel);
|
||||
}
|
||||
}
|
@ -7,7 +7,6 @@ import io.rixa.bot.utils.MessageFactory;
|
||||
import net.dv8tion.jda.core.entities.Guild;
|
||||
import net.dv8tion.jda.core.entities.Member;
|
||||
import net.dv8tion.jda.core.entities.TextChannel;
|
||||
import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent;
|
||||
|
||||
public class PingCommand extends Command {
|
||||
|
||||
|
@ -102,8 +102,6 @@ public class MessageListener {
|
||||
commandName = commandName.replaceFirst(prefix, "");
|
||||
try {
|
||||
Command command = Rixa.getInstance().getCommandHandler().getCommand(commandName);
|
||||
//command.execute(event);
|
||||
event.getMessage().delete().queueAfter(3, TimeUnit.SECONDS);
|
||||
RixaGuild rixaGuild = GuildManager.getInstance().getGuild(event.getGuild());
|
||||
if (!event.getGuild().getOwner().getUser().getId().equalsIgnoreCase(event.getAuthor().getId())
|
||||
&& command.getPermission() != null && command.getPermission() != RixaPermission.NONE &&
|
||||
|
@ -31,7 +31,7 @@ public class AudioPlayerSendHandler implements AudioSendHandler {
|
||||
lastFrame = audioPlayer.provide();
|
||||
}
|
||||
|
||||
byte[] data = lastFrame != null ? lastFrame.data : null;
|
||||
byte[] data = lastFrame != null ? lastFrame.getData() : null;
|
||||
lastFrame = null;
|
||||
|
||||
return data;
|
||||
|
@ -32,7 +32,7 @@ public class MessageFactory {
|
||||
|
||||
public MessageFactory() {
|
||||
this.builder = new EmbedBuilder();
|
||||
selfDestruct = 20;
|
||||
selfDestruct = 0;
|
||||
}
|
||||
|
||||
public MessageFactory setTitle(String title, String url) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
token: "YOUR_TOKEN_HERE"
|
||||
botGame: "Rixa 2.0 | http://rixa.io/invite"
|
||||
token: "kIWC67smb8Ysmxwj_Q1XaqWA4ciNQw2F"
|
||||
botGame: "Rixa 3.0 beta | Hosted by Mister_Fix"
|
||||
shards: 5
|
||||
|
||||
botAdmins:
|
||||
- "YOUR_USER_ID_HERE"
|
||||
- "OTHER_ADMINS"
|
||||
- "REMOVE_IF_YOU_DONT_WANT"
|
||||
- "104695503358291968"
|
||||
|
||||
sqlCredentials:
|
||||
hostName: "localhost"
|
||||
databaseName: "rixa"
|
||||
userName: "rixa_users"
|
||||
password: "password"
|
||||
userName: "root"
|
||||
password: ""
|
||||
port: "3306"
|
||||
|
Loading…
Reference in New Issue
Block a user