Merge remote-tracking branch 'origin/master'

# Conflicts:
#	discordbot/src/main/java/zone/themcgamer/discordbot/command/impl/InviteCommand.java
This commit is contained in:
Nicholas Rees 2021-03-15 17:49:37 -05:00
commit 9542ae5be0
5 changed files with 14 additions and 9 deletions

@ -16,7 +16,7 @@ import java.util.List;
public class AddReactionToMessageCommand extends BaseCommand { public class AddReactionToMessageCommand extends BaseCommand {
public AddReactionToMessageCommand() { public AddReactionToMessageCommand() {
name = "addreaction"; name = "addreaction";
aliases = new String[]{"react"}; aliases = new String[] { "react" };
help = "Edit a message from the bot."; help = "Edit a message from the bot.";
arguments = "<channelID> <messageID> <reaction>"; arguments = "<channelID> <messageID> <reaction>";
userPermissions = new Permission[] { Permission.ADMINISTRATOR }; userPermissions = new Permission[] { Permission.ADMINISTRATOR };

@ -16,7 +16,7 @@ import java.util.List;
public class EditMessageCommand extends BaseCommand { public class EditMessageCommand extends BaseCommand {
public EditMessageCommand() { public EditMessageCommand() {
name = "edit"; name = "edit";
aliases = new String[]{"editmessage"}; aliases = new String[] { "editmessage" };
help = "Edit a message from the bot."; help = "Edit a message from the bot.";
arguments = "<channelID> <messageID> <title> <description>"; arguments = "<channelID> <messageID> <title> <description>";
userPermissions = new Permission[] { Permission.ADMINISTRATOR }; userPermissions = new Permission[] { Permission.ADMINISTRATOR };

@ -10,9 +10,10 @@ import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
public class InviteCommand extends BaseCommand { public class InviteCommand extends BaseCommand {
public InviteCommand() { public InviteCommand() {
name = "invite"; name = "invite";
aliases = new String[] { "createinvite" }; aliases = new String[]{"createinvite"};
help = "Create invite link via the bot"; help = "Create invite link via the bot";
guildOnly = true; guildOnly = true;
guilds = Collections.singletonList(zone.themcgamer.discordbot.guild.Guild.MAIN); guilds = Collections.singletonList(zone.themcgamer.discordbot.guild.Guild.MAIN);
@ -21,6 +22,7 @@ public class InviteCommand extends BaseCommand {
@Override @Override
protected void execute(CommandEvent event, List<String> args) { protected void execute(CommandEvent event, List<String> args) {
Guild guild = event.getGuild(); Guild guild = event.getGuild();
TextChannel textChannelById = guild.getTextChannelById(791015530001596456L); TextChannel textChannelById = guild.getTextChannelById(791015530001596456L);
if (textChannelById == null) if (textChannelById == null)
return; return;
@ -29,8 +31,12 @@ public class InviteCommand extends BaseCommand {
.setTemporary(true).queue(inviteLink -> { .setTemporary(true).queue(inviteLink -> {
event.getMember().getUser().openPrivateChannel().queue(privateChannel -> { event.getMember().getUser().openPrivateChannel().queue(privateChannel -> {
privateChannel.sendMessage("I have generated an invite link for you! This invite link will work for 24 hours! " + inviteLink.getUrl()).queue(); privateChannel.sendMessage("I have generated an invite link for you! This invite link will work for 24 hours! " + inviteLink.getUrl()).queue();
event.reply("Check your DMs!"); event.reply("Check your dm's!");
}, error -> event.replyError("Could not sent you a dm!")); }, error -> {
}, error -> event.replyError("Couldn't create an invite link due to an error!")); event.replyError("Could not sent you a dm!");
}); }, error -> {
event.replyError("Coulnd't create an invite link due an error!");
});
} }
} }

@ -12,7 +12,6 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
public class MessageCommand extends BaseCommand { public class MessageCommand extends BaseCommand {
public MessageCommand() { public MessageCommand() {
name = "message"; name = "message";
aliases = new String[] { "say" }; aliases = new String[] { "say" };
@ -36,4 +35,4 @@ public class MessageCommand extends BaseCommand {
embedBuilder.setDescription(event.getMessage().getContentRaw().replace(args.get(1), "").replace("." + args.get(0), "")); embedBuilder.setDescription(event.getMessage().getContentRaw().replace(args.get(1), "").replace("." + args.get(0), ""));
event.getChannel().sendMessage(embedBuilder.build()).queue(); event.getChannel().sendMessage(embedBuilder.build()).queue();
} }
} }

@ -41,7 +41,7 @@ public class GuildUtils {
}, error -> { }, error -> {
EmbedBuilder embedBuilder = EmbedUtils.successEmbed(); EmbedBuilder embedBuilder = EmbedUtils.successEmbed();
embedBuilder.setTitle("Role Manager"); embedBuilder.setTitle("Role Manager");
embedBuilder.setDescription("Succesfully toggled " + role.getName() + " " + (!member.getRoles().contains(role) ? "On" : "Off")); embedBuilder.setDescription("Successfully toggled " + role.getName() + " " + (!member.getRoles().contains(role) ? "On" : "Off"));
TextChannel textChannelById = guild.getTextChannelById(813139125195898880L); TextChannel textChannelById = guild.getTextChannelById(813139125195898880L);
if (textChannelById == null) if (textChannelById == null)
return; return;