diff --git a/src/Enums/ConnectionService.php b/src/Enums/ConnectionService.php new file mode 100644 index 0000000..de9a78f --- /dev/null +++ b/src/Enums/ConnectionService.php @@ -0,0 +1,35 @@ + + */ + public function getCurrentUserConnections(): PromiseInterface + { + return $this->mapPromise( + $this->http->get( + Endpoint::USER_CURRENT_CONNECTIONS, + ), + Connection::class, + ); + } + + /** + * @see https://discord.com/developers/docs/resources/user#get-current-user-application-role-connection + * + * @return PromiseInterface<\Ragnarok\Fenrir\Parts\ApplicationRoleConnection> + */ + public function getCurrentUserApplicationRoleConnection(): PromiseInterface + { + return $this->mapPromise( + $this->http->get( + Endpoint::USER_CURRENT_APPLICATION_ROLE_CONNECTION, + ), + ApplicationRoleConnection::class, + ); + } + + /** + * @see https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection + * + * @return PromiseInterface<\Ragnarok\Fenrir\Parts\ApplicationRoleConnection> + */ + public function updateCurrentUserApplicationRoleConnection(array $params): PromiseInterface + { + return $this->mapPromise( + $this->http->put( + Endpoint::USER_CURRENT_APPLICATION_ROLE_CONNECTION, + $params + ), + ApplicationRoleConnection::class, + ); + } }