Skip to content

Commit

Permalink
upgrade source managers
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Feb 8, 2021
1 parent b9a444f commit f253a9c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ dependencies {
exclude(module = "opus-java")
}*/

implementation(group = "com.dunctebot", name = "sourcemanagers", version = "1.4.0")
implementation(group = "com.github.DuncteBot", name = "skybot-source-managers", version = "1.5.0")
// Lavaplayer/Lavalink
implementation(group = "com.sedmelluq", name = "lavaplayer", version = "1.3.67")
implementation(group = "com.github.dunctebot", name = "Lavalink-Client", version = "478fbea")
implementation(group = "com.github.DuncteBot", name = "Lavalink-Client", version = "d2fb620")
// implementation(project(":Lavalink-Client"))

//groovy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package ml.duncte123.skybot.audio.sourcemanagers.spotify;

import com.dunctebot.sourcemanagers.AudioTrackInfoWithImage;
import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager;
import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager;
import com.sedmelluq.discord.lavaplayer.source.AudioSourceManager;
import com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager;
import com.sedmelluq.discord.lavaplayer.tools.ExceptionTools;
Expand Down Expand Up @@ -96,7 +96,7 @@ public String getSourceName() {
}

@Override
public AudioItem loadItem(DefaultAudioPlayerManager manager, AudioReference reference) {
public AudioItem loadItem(AudioPlayerManager manager, AudioReference reference) {
return loadItem(reference, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public YoutubeAudioSourceManagerOverride(CacheClient cacheClient, String ytApiKe
true,
new DefaultYoutubeTrackDetailsLoader(),
new YoutubeApiSearchProvider(ytApiKey, cacheClient),
new YoutubeSearchMusicProvider(),
new YoutubeSignatureCipherManager(),
new YoutubeApiPlaylistLoader(ytApiKey),
new DefaultYoutubeLinkRouter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,9 @@ private void swearFilterSetting(CommandContext ctx, String name, boolean setValu
private void inviteLoggingSetting(CommandContext ctx, String name, boolean setValue) {
final DunctebotGuild guild = ctx.getGuild();
final GuildSetting settings = guild.getSettings();
final boolean isEnabled = !settings.isInviteLoggingEnabled();
final boolean isEnabled = !settings.isFilterInvites();

guild.setSettings(settings.setInviteLoggingEnabled(isEnabled));
guild.setSettings(settings.setFilterInvites(isEnabled));
sendMsg(ctx, "The logging of invites has been toggled **" +
(isEnabled ? "on" : "off") + "**");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,6 @@ private boolean isInviteLoggingEnabled(Guild guild) {

final GuildSetting guildSetting = GuildSettingsUtils.getGuild(guild.getIdLong(), variables);

return guildSetting.isInviteLoggingEnabled();
return guildSetting.isFilterInvites();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class SqliteDatabaseAdapter : DatabaseAdapter(1) {
it.setString(24, guildSettings.filterType.type)
it.setFloat(25, guildSettings.aiSensitivity)
it.setBoolean(26, guildSettings.isAllowAllToStop)
it.setBoolean(27, guildSettings.isInviteLoggingEnabled)
it.setBoolean(27, guildSettings.isFilterInvites)
it.setBoolean(28, guildSettings.isYoungAccountBanEnabled)
it.setInt(29, guildSettings.youngAccountThreshold)
it.executeUpdate()
Expand Down Expand Up @@ -1134,7 +1134,7 @@ class SqliteDatabaseAdapter : DatabaseAdapter(1) {
.setFilterType(this.getString("profanity_type"))
.setAiSensitivity(this.getFloat("aiSensitivity"))
.setAllowAllToStop(this.getBoolean("allow_all_to_stop"))
.setInviteLoggingEnabled(this.getBoolean("invite_logging"))
.setFilterInvites(this.getBoolean("invite_logging"))
.setBlacklistedWords(blackList)
.setWarnActions(warnActions)
.setEmbedColor(embedColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class GuildSettingsHandler(private val variables: Variables, client: WebSocketCl
val tracker = guild.globalInviteTracker

// setting was turned on
if (oldSetting?.isInviteLoggingEnabled == false && setting.isInviteLoggingEnabled) {
if (oldSetting?.isFilterInvites == false && setting.isFilterInvites) {
if (CommandUtils.isGuildPatron(guild)) {
tracker.attemptInviteCaching(guild)
}
// setting was turned off
} else if (oldSetting?.isInviteLoggingEnabled == true && !setting.isInviteLoggingEnabled) {
} else if (oldSetting?.isFilterInvites == true && !setting.isFilterInvites) {
tracker.clearInvites(setting.guildId)
}
}
Expand Down

0 comments on commit f253a9c

Please sign in to comment.