User.from constructor
User.from(
- dynamic payload
Implementation
factory User.from(dynamic payload) {
return User(
payload['id'],
payload['username'],
payload['discriminator'],
payload['bot'] == true,
payload['public_flags'] ?? 0,
payload['avatar'] != null ? ImageFormater(payload['avatar'], 'avatars/${payload['id']}') : null,
payload['avatar_decoration'] != null ? ImageFormater(payload['avatar'], 'avatars/${payload['id']}') : null,
payload['locale'] ?? 'en-GB',
);
}