예제 #1
0
        public async Task <AvatarImageWrapper> GetAvatarAsync(SocketGuild guild, ulong userId, ushort discordSize = 128, MagickGeometry size = null)
        {
            if (guild == null)
            {
                throw new ArgumentNullException(nameof(guild));
            }

            IUser user = await guild.GetUserAsync(userId);

            user ??= await Client.Rest.GetUserAsync(userId);

            if (user == null)
            {
                return(CreateFallbackAvatarWrapper(size));
            }
            else
            {
                return(await GetAvatarAsync(user, discordSize, size));
            }
        }