[DayliMadame] Check permission before sending message to prevent crash

This commit is contained in:
Sebastien 2019-09-27 09:17:12 +02:00
parent 2473d0d0a4
commit 1389a11e46

View File

@ -65,7 +65,7 @@ public class DailyMadame implements NewDayListener{
if(guildPreferenceRepository.findByGuildId(guild.getId()).get(0).isDailyMadame()){ if(guildPreferenceRepository.findByGuildId(guild.getId()).get(0).isDailyMadame()){
for(TextChannel iterator : guild.getTextChannels()) for(TextChannel iterator : guild.getTextChannels())
{ {
if(iterator.isNSFW()){ if(iterator.isNSFW() && iterator.canTalk()){
chanel = iterator; chanel = iterator;
logger.debug("break: " + chanel.getName()); logger.debug("break: " + chanel.getName());
break; break;