示例#1
0
        public static async Task <DiscordBan> GetGuildBanAsync(this DiscordClient client, ulong guildId, ulong userId)
        {
            DiscordBan ban = (await client.HttpClient.GetAsync($"/guilds/{guildId}/bans/{userId}"))
                             .Deserialize <DiscordBan>().SetClient(client);

            ban.GuildId = guildId;
            return(ban);
        }
示例#2
0
        /// <summary>
        /// Gets a guild's banned user
        /// </summary>
        /// <param name="guildId">ID of the guild</param>
        /// <param name="userId">ID of the user</param>
        /// <returns></returns>
        public static DiscordBan GetGuildBan(this DiscordClient client, ulong guildId, ulong userId)
        {
            DiscordBan ban = client.HttpClient.Get($"/guilds/{guildId}/bans/{userId}")
                             .Deserialize <DiscordBan>().SetClient(client);

            ban.GuildId = guildId;
            return(ban);
        }