Did lots of stuff.

This commit is contained in:
Andrew Lalis 2017-07-02 15:38:42 +02:00 committed by Andrew Lalis
parent bca2921e67
commit e115808e54
5 changed files with 9 additions and 8 deletions

View File

@ -70,7 +70,7 @@
<dependency>
<groupId>com.github.andrewlalis</groupId>
<artifactId>TengwarTranslatorLibrary</artifactId>
<version>1.1</version>
<version>1.2</version>
</dependency>
</dependencies>

View File

@ -31,15 +31,15 @@ public class TengwarCommand extends ContextCommand {
String result = Translator.translateToTengwar(input);
try {
context.getChannel().sendFile("Raw text: `" +result+'`', TengwarImageGenerator.generateImage(result,
400,
20f,
600,
24f,
false,
false,
System.getProperty("user.home")+"/.handiebot/tengwarTemp.png"));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
} else if (context.getArgs()[0].equalsIgnoreCase("to")){
} else if (context.getArgs()[0].equalsIgnoreCase("from")){
context.getChannel().sendMessage(Translator.translateToEnglish(input));
}
} else {

View File

@ -25,7 +25,7 @@ public class RepeatCommand extends ContextCommand {
@Override
public void execute(CommandContext context) {
if (context.getArgs().length == 1 && Commands.hasPermission(context, 8)){
boolean shouldRepeat = Boolean.getBoolean(context.getArgs()[0].toLowerCase());
boolean shouldRepeat = (context.getArgs()[0].toLowerCase().equals("true"));
HandieBot.musicPlayer.setRepeat(context.getGuild(), shouldRepeat);
} else {
context.getChannel().sendMessage(MessageFormat.format(resourceBundle.getString("player.getRepeat"), HandieBot.musicPlayer.isRepeating(context.getGuild())));

View File

@ -25,7 +25,7 @@ public class ShuffleCommand extends ContextCommand {
@Override
public void execute(CommandContext context) {
if (context.getArgs().length == 1 && Commands.hasPermission(context, 8)){
boolean shouldShuffle = Boolean.getBoolean(context.getArgs()[0].toLowerCase());
boolean shouldShuffle = (context.getArgs()[0].toLowerCase().equals("true"));
HandieBot.musicPlayer.setShuffle(context.getGuild(), shouldShuffle);
} else {
context.getChannel().sendMessage(MessageFormat.format(resourceBundle.getString("player.getShuffle"), HandieBot.musicPlayer.isShuffling(context.getGuild())));

View File

@ -5,6 +5,7 @@ import handiebot.view.BotLog;
import sx.blah.discord.handle.obj.IChannel;
import sx.blah.discord.handle.obj.IMessage;
import sx.blah.discord.handle.obj.Permissions;
import sx.blah.discord.util.RequestBuffer;
import static handiebot.HandieBot.log;
import static handiebot.HandieBot.resourceBundle;
@ -29,7 +30,7 @@ public class DisappearingMessage extends Thread implements Runnable {
e.printStackTrace();
}
if (canDelete(sentMessage))
sentMessage.delete();
RequestBuffer.request(() -> sentMessage.delete());
}
/**
@ -45,7 +46,7 @@ public class DisappearingMessage extends Thread implements Runnable {
e.printStackTrace();
}
if (canDelete(message))
message.delete();
RequestBuffer.request(() -> message.delete());
}).start();
}