fix: Issues related to absence of bot scope (#2352)
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Discord.WebSocket
|
||||
}
|
||||
internal new static SocketCategoryChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var entity = new SocketCategoryChannel(guild.Discord, model.Id, guild);
|
||||
var entity = new SocketCategoryChannel(guild?.Discord, model.Id, guild);
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Discord.WebSocket
|
||||
|
||||
internal new static SocketForumChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var entity = new SocketForumChannel(guild.Discord, model.Id, guild);
|
||||
var entity = new SocketForumChannel(guild?.Discord, model.Id, guild);
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Discord.WebSocket
|
||||
}
|
||||
internal new static SocketNewsChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var entity = new SocketNewsChannel(guild.Discord, model.Id, guild);
|
||||
var entity = new SocketNewsChannel(guild?.Discord, model.Id, guild);
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Discord.WebSocket
|
||||
|
||||
internal new static SocketStageChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var entity = new SocketStageChannel(guild.Discord, model.Id, guild);
|
||||
var entity = new SocketStageChannel(guild?.Discord, model.Id, guild);
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -61,12 +61,12 @@ namespace Discord.WebSocket
|
||||
internal SocketTextChannel(DiscordSocketClient discord, ulong id, SocketGuild guild)
|
||||
: base(discord, id, guild)
|
||||
{
|
||||
if (Discord.MessageCacheSize > 0)
|
||||
if (Discord?.MessageCacheSize > 0)
|
||||
_messages = new MessageCache(Discord);
|
||||
}
|
||||
internal new static SocketTextChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var entity = new SocketTextChannel(guild.Discord, model.Id, guild);
|
||||
var entity = new SocketTextChannel(guild?.Discord, model.Id, guild);
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Discord.WebSocket
|
||||
}
|
||||
internal new static SocketVoiceChannel Create(SocketGuild guild, ClientState state, Model model)
|
||||
{
|
||||
var entity = new SocketVoiceChannel(guild.Discord, model.Id, guild);
|
||||
var entity = new SocketVoiceChannel(guild?.Discord, model.Id, guild);
|
||||
entity.Update(state, model);
|
||||
return entity;
|
||||
}
|
||||
@@ -58,8 +58,8 @@ namespace Discord.WebSocket
|
||||
internal override void Update(ClientState state, Model model)
|
||||
{
|
||||
base.Update(state, model);
|
||||
Bitrate = model.Bitrate.Value;
|
||||
UserLimit = model.UserLimit.Value != 0 ? model.UserLimit.Value : (int?)null;
|
||||
Bitrate = model.Bitrate.GetValueOrDefault(64000);
|
||||
UserLimit = model.UserLimit.GetValueOrDefault() != 0 ? model.UserLimit.Value : (int?)null;
|
||||
RTCRegion = model.RTCRegion.GetValueOrDefault(null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user