diff --git a/.idea/JdrBot.iml b/.idea/JdrBot.iml
deleted file mode 100644
index d6ebd48..0000000
--- a/.idea/JdrBot.iml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index be03264..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/java/fr/Skydust/JdrBot/cmds/record/Record.java b/src/main/java/fr/Skydust/JdrBot/cmds/record/Record.java
index 74d9f8b..208d413 100755
--- a/src/main/java/fr/Skydust/JdrBot/cmds/record/Record.java
+++ b/src/main/java/fr/Skydust/JdrBot/cmds/record/Record.java
@@ -24,22 +24,27 @@ public class Record extends Command {
@Override
public void call(GuildMessageReceivedEvent e)
{
- if(e.getGuild().getMember(e.getAuthor()).hasPermission(Permission.ADMINISTRATOR)) {
+ if(e.getMember().hasPermission(Permission.ADMINISTRATOR)) {
RecordState currentRS = getGuildRecordState(e.getGuild());
- if (e.getGuild().getMember(e.getAuthor()).getVoiceState().getChannel() != null && !currentRS.isRecording && !currentRS.isProcessing) {
+ if (currentRS.isProcessing) {
+ Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est en cours de finalisation");
+ return;
+ }
+ if (currentRS.isRecording) {
+ Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est déjà en cours");
+ return;
+ }
+
+ if (e.getMember().getVoiceState().getChannel() != null) {
Utils.sendMessage(e.getChannel(), MessageType.NORMAL, "Lancement d'un enregistrement par " + e.getAuthor().getAsMention() + "\n`!stoprecord` pour le terminer\n`!crecord` pour annuler");
System.out.println("[" + new Date() + "] Le serveur ID " + e.getGuild().getId() + "(" + e.getGuild().getName() + ") vient de lancer un enregistrement");
- e.getGuild().getAudioManager().openAudioConnection(e.getGuild().getMember(e.getAuthor()).getVoiceState().getChannel());
+ e.getGuild().getAudioManager().openAudioConnection(e.getMember().getVoiceState().getChannel());
currentRS.newRecord();
currentRS.isRecording = true;
- } else if (currentRS.isProcessing) {
- Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est en cours de finalisation");
- } else if (currentRS.isRecording) {
- Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est déjà en cours");
} else {
Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Vous n'êtes pas dans un salon vocal");
}
diff --git a/src/main/java/fr/Skydust/JdrBot/stock/RecordState.java b/src/main/java/fr/Skydust/JdrBot/stock/RecordState.java
index bd1ebb2..8bb1bc1 100755
--- a/src/main/java/fr/Skydust/JdrBot/stock/RecordState.java
+++ b/src/main/java/fr/Skydust/JdrBot/stock/RecordState.java
@@ -146,7 +146,7 @@ public class RecordState {
* Defines a default audio format used to record
*/
private AudioFormat getAudioFormat() {
- float sampleRate = 44100;
+ float sampleRate = 48000;
int sampleSizeInBits = 16;
int channels = 2;
boolean signed = true;
diff --git a/src/main/resources/META-INF/MANIFEST.MF b/src/main/resources/META-INF/MANIFEST.MF
index 862686b..e92e3e5 100644
--- a/src/main/resources/META-INF/MANIFEST.MF
+++ b/src/main/resources/META-INF/MANIFEST.MF
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
-Main-Class: fr.Skydust.JdrBot.JdrBot
+Main-Class: fr.Skydust.JdrBot.JdrBot;