Merge branch 'master' into master
This commit is contained in:
commit
4fc3431213
@ -1,6 +1,7 @@
|
|||||||
package cc.fascinated.bat.features.spotify.command;
|
package cc.fascinated.bat.features.spotify.command;
|
||||||
|
|
||||||
import cc.fascinated.bat.command.BatCommand;
|
import cc.fascinated.bat.command.BatCommand;
|
||||||
|
import cc.fascinated.bat.command.Category;
|
||||||
import cc.fascinated.bat.command.CommandInfo;
|
import cc.fascinated.bat.command.CommandInfo;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -11,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||||||
* @author Fascinated (fascinated7)
|
* @author Fascinated (fascinated7)
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@CommandInfo(name = "spotify", description = "Change your Spotify settings", guildOnly = false)
|
@CommandInfo(name = "spotify", description = "Change your Spotify settings", guildOnly = false, category = Category.MUSIC)
|
||||||
public class SpotifyCommand extends BatCommand {
|
public class SpotifyCommand extends BatCommand {
|
||||||
@Autowired
|
@Autowired
|
||||||
public SpotifyCommand(@NonNull ApplicationContext context) {
|
public SpotifyCommand(@NonNull ApplicationContext context) {
|
||||||
|
@ -50,7 +50,7 @@ public class GuildService extends ListenerAdapter {
|
|||||||
if (premium.getExpiresAt() != null && premium.getExpiresAt().before(new Date())) {
|
if (premium.getExpiresAt() != null && premium.getExpiresAt().before(new Date())) {
|
||||||
premium.removePremium();
|
premium.removePremium();
|
||||||
guildRepository.save(guild);
|
guildRepository.save(guild);
|
||||||
log.info("Removed premium status from guild \"{}\"", guild.getId());
|
log.info("Removed premium status from guild \"{}\"", guild.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ public class GuildService extends ListenerAdapter {
|
|||||||
return guild;
|
return guild;
|
||||||
}
|
}
|
||||||
BatGuild guild = guildRepository.save(new BatGuild(id));
|
BatGuild guild = guildRepository.save(new BatGuild(id));
|
||||||
log.info("Created guild \"{}\" in {}ms", id, System.currentTimeMillis() - start);
|
log.info("Created guild \"{}\" in {}ms", guild.getName(), System.currentTimeMillis() - start);
|
||||||
return guild;
|
return guild;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public class GuildService extends ListenerAdapter {
|
|||||||
@Override
|
@Override
|
||||||
public final void onGuildJoin(GuildJoinEvent event) {
|
public final void onGuildJoin(GuildJoinEvent event) {
|
||||||
Guild guild = event.getGuild();
|
Guild guild = event.getGuild();
|
||||||
log.info("Joined guild \"{}\"", guild.getId());
|
log.info("Joined guild \"{}\"", guild.getName());
|
||||||
getGuild(guild.getId()); // Ensure the guild is in the database
|
getGuild(guild.getId()); // Ensure the guild is in the database
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user