Browse Source

Fixes

master
Niklas H. 1 month ago
parent
commit
7084379c50
2 changed files with 6 additions and 2 deletions
  1. +4
    -0
      CountDownDiscordBot.iml
  2. +2
    -2
      src/main/java/de/moddylp/wolftimerbot/commands/CountDown.java

+ 4
- 0
CountDownDiscordBot.iml View File

@@ -6,10 +6,14 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
<orderEntry type="library" name="Maven: com.mewna:catnip:2.0.0-rc2" level="project" />
<orderEntry type="library" name="Maven: io.reactivex.rxjava2:rxjava:2.2.16" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />

+ 2
- 2
src/main/java/de/moddylp/wolftimerbot/commands/CountDown.java View File

@@ -75,7 +75,7 @@ public class CountDown {
Objects.requireNonNull(msg.guild()).members().forEach(member -> {
MemberData data = MemberData.of(member);
if (data.roles().contains(role.id()) && msg.guildId() != null) {
if (msg.guild().channel(data.channelId()).isVoice()) {
if (data.channelId() != null && msg.guild().channel(data.channelId()).isVoice()) {
Main.logger.info("Muted Member: " + member.user().username());
catnip.rest().guild().modifyGuildMember(Objects.requireNonNull(msg.guildId()), member.id(), data.mute(false), "Werwolf-Spiel").subscribe(() -> {
Main.logger.info(member.user().username() + " demutet");
@@ -87,12 +87,12 @@ public class CountDown {
}
}
});

});
msg.channel().sendMessage(emb.description("Alle wurden wieder entmutet")).doOnError(error -> {
msg.channel().sendMessage("Can't edit Embed. " + error.getMessage());
});
} catch (Exception ex) {
Main.logger.error(ex.getMessage(), ex);
msg.channel().sendMessage(emb.description("Etwas ist schief gelaufen"));
}
} else {

Loading…
Cancel
Save