Make Make GetShardFor(ulong guildId) & DiscordShardedClient.GetUserAsync() public (#3075)
* Make GetShardFor(ulong guildId) public * Make DiscordShardedClient.GetUserAsync() public
This commit is contained in:
@@ -215,7 +215,7 @@ namespace Discord.WebSocket
|
|||||||
=> (int)((guildId >> 22) % (uint)_totalShards);
|
=> (int)((guildId >> 22) % (uint)_totalShards);
|
||||||
public int GetShardIdFor(IGuild guild)
|
public int GetShardIdFor(IGuild guild)
|
||||||
=> GetShardIdFor(guild?.Id ?? 0);
|
=> GetShardIdFor(guild?.Id ?? 0);
|
||||||
private DiscordSocketClient GetShardFor(ulong guildId)
|
public DiscordSocketClient GetShardFor(ulong guildId)
|
||||||
=> GetShard(GetShardIdFor(guildId));
|
=> GetShard(GetShardIdFor(guildId));
|
||||||
public DiscordSocketClient GetShardFor(IGuild guild)
|
public DiscordSocketClient GetShardFor(IGuild guild)
|
||||||
=> GetShardFor(guild?.Id ?? 0);
|
=> GetShardFor(guild?.Id ?? 0);
|
||||||
@@ -611,7 +611,7 @@ namespace Discord.WebSocket
|
|||||||
=> await CreateGuildAsync(name, region, jpegIcon).ConfigureAwait(false);
|
=> await CreateGuildAsync(name, region, jpegIcon).ConfigureAwait(false);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
async Task<IUser> IDiscordClient.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
|
public async Task<IUser> GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
|
||||||
{
|
{
|
||||||
var user = GetUser(id);
|
var user = GetUser(id);
|
||||||
if (user is not null || mode == CacheMode.CacheOnly)
|
if (user is not null || mode == CacheMode.CacheOnly)
|
||||||
|
|||||||
Reference in New Issue
Block a user