createInvitation method
Uri
createInvitation({
- List<
ClientPermission> permissions = const [], - List<
ClientScope> scope = const [],
Implementation
Uri createInvitation ({ List<ClientPermission> permissions = const [], List<ClientScope> scope = const [] }) {
int _permissions = permissions.fold(0, (acc, element) => acc += element.value);
return Uri(
host: 'discord.com',
scheme: 'https',
path: '/api/oauth2/authorize',
queryParameters: {
'client_id': user.id,
'permissions': _permissions.toString(),
'scope': scope.map((scope) => scope.value).join(' ')
}
);
}