Fix daily madame 🎉
This commit is contained in:
parent
87e820f6fe
commit
ada6e24380
@ -20,7 +20,7 @@ public class Madame extends NumberedCommande {
|
|||||||
public String HELP = "Yo really? Just type Madame to see some :cat:";
|
public String HELP = "Yo really? Just type Madame to see some :cat:";
|
||||||
|
|
||||||
public Madame() {
|
public Madame() {
|
||||||
super(LogManager.getLogger(), "http://www.bonjourmadame.fr/page/", "/");
|
super(LogManager.getLogger(), "https://www.bonjourmadame.fr/page/", "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.Broken.Tools.DayListener.Listeners;
|
package net.Broken.Tools.DayListener.Listeners;
|
||||||
|
|
||||||
import net.Broken.Commands.Over18.Madame;
|
import net.Broken.Commands.Over18.Madame;
|
||||||
|
import net.Broken.DB.Entity.GuildPreferenceEntity;
|
||||||
import net.Broken.DB.Repository.GuildPreferenceRepository;
|
import net.Broken.DB.Repository.GuildPreferenceRepository;
|
||||||
import net.Broken.MainBot;
|
import net.Broken.MainBot;
|
||||||
import net.Broken.SpringContext;
|
import net.Broken.SpringContext;
|
||||||
@ -46,7 +47,7 @@ public class DailyMadame implements NewDayListener{
|
|||||||
LocalDate now = LocalDate.now().minusDays(1);
|
LocalDate now = LocalDate.now().minusDays(1);
|
||||||
String date = DateTimeFormatter.ofPattern("yyyy/MM/dd").format(now);
|
String date = DateTimeFormatter.ofPattern("yyyy/MM/dd").format(now);
|
||||||
|
|
||||||
String url = "http://www.bonjourmadame.fr/" + date + "/";
|
String url = "https://www.bonjourmadame.fr/" + date + "/";
|
||||||
|
|
||||||
imgUrl = FindContentOnWebPage.doYourJob(url, "post-content", "img");
|
imgUrl = FindContentOnWebPage.doYourJob(url, "post-content", "img");
|
||||||
|
|
||||||
@ -62,7 +63,8 @@ public class DailyMadame implements NewDayListener{
|
|||||||
for(Guild guild : guilds){
|
for(Guild guild : guilds){
|
||||||
TextChannel chanel = null;
|
TextChannel chanel = null;
|
||||||
logger.debug(guild.getName());
|
logger.debug(guild.getName());
|
||||||
if(guildPreferenceRepository.findByGuildId(guild.getId()).get(0).isDailyMadame()){
|
List<GuildPreferenceEntity> guildPref = guildPreferenceRepository.findByGuildId(guild.getId());
|
||||||
|
if( guildPref.size() > 0 && guildPref.get(0).isDailyMadame()){
|
||||||
for(TextChannel iterator : guild.getTextChannels())
|
for(TextChannel iterator : guild.getTextChannels())
|
||||||
{
|
{
|
||||||
if(iterator.isNSFW() && iterator.canTalk()){
|
if(iterator.isNSFW() && iterator.canTalk()){
|
||||||
|
Loading…
Reference in New Issue
Block a user