mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
Using pattern matching for nulls where applicable, discarded unused lambda parameters, cleaned up some classes. Unignored ServerLog commands which was mistakenly ignored due to a .gitignore rule
This commit is contained in:
@@ -68,7 +68,7 @@ public sealed partial class Music
|
||||
await using var uow = _db.GetDbContext();
|
||||
var pl = uow.MusicPlaylists.FirstOrDefault(x => x.Id == id);
|
||||
|
||||
if (pl != null)
|
||||
if (pl is not null)
|
||||
if (_creds.IsOwner(ctx.User) || pl.AuthorId == ctx.User.Id)
|
||||
{
|
||||
uow.MusicPlaylists.Remove(pl);
|
||||
@@ -212,7 +212,7 @@ public sealed partial class Music
|
||||
await mp.EnqueueManyAsync(mpl.Songs.Select(x => (x.Query, (MusicPlatform)x.ProviderType)),
|
||||
ctx.User.ToString());
|
||||
|
||||
if (msg != null) await msg.ModifyAsync(m => m.Content = GetText(strs.playlist_queue_complete));
|
||||
if (msg is not null) await msg.ModifyAsync(m => m.Content = GetText(strs.playlist_queue_complete));
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@@ -176,7 +176,7 @@ public sealed class AyuVoiceStateService : INService
|
||||
}
|
||||
|
||||
var current = _voiceProxies.AddOrUpdate(guildId,
|
||||
gid => new VoiceProxy(CreateVoiceGatewayLocal()),
|
||||
_ => new VoiceProxy(CreateVoiceGatewayLocal()),
|
||||
(gid, currentProxy) =>
|
||||
{
|
||||
_ = currentProxy.StopGateway();
|
||||
|
@@ -214,7 +214,7 @@ public sealed class MusicService : IMusicService
|
||||
}
|
||||
|
||||
private Func<IMusicPlayer, Task> OnQueueStopped(ulong guildId)
|
||||
=> mp =>
|
||||
=> _ =>
|
||||
{
|
||||
if (_settings.TryGetValue(guildId, out var settings))
|
||||
if (settings.AutoDisconnect)
|
||||
@@ -355,7 +355,7 @@ public sealed class MusicService : IMusicService
|
||||
},
|
||||
channelId);
|
||||
|
||||
_outputChannels.AddOrUpdate(guildId, (channel, channel), (key, old) => (old.Default, channel));
|
||||
_outputChannels.AddOrUpdate(guildId, (channel, channel), (_, old) => (old.Default, channel));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user