Skip to content

Commit 8903989

Browse files
committed
IntegrationRepository::sync($integration_id)
1 parent 0420194 commit 8903989

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Discord/Repository/Guild/IntegrationRepository.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Discord\Http\Endpoint;
1818
use Discord\Parts\Guild\Integration;
1919
use Discord\Repository\AbstractRepository;
20+
use React\Promise\PromiseInterface;
2021

2122
/**
2223
* Contains integrations on a guild.
@@ -46,4 +47,24 @@ class IntegrationRepository extends AbstractRepository
4647
* @inheritDoc
4748
*/
4849
protected $class = Integration::class;
50+
51+
/**
52+
* Syncs an integration for the guild.
53+
*
54+
* Requires the MANAGE_GUILD permission.
55+
*
56+
* Returns a 204 empty response on success.
57+
*
58+
* Fires Guild Integrations Update and Integration Update Gateway events.
59+
*
60+
* @link https://discord.com/developers/docs/resources/guild#sync-guild-integration
61+
*
62+
* @param string $integrationId
63+
*
64+
* @return PromiseInterface
65+
*/
66+
public function sync(string $integration_id): PromiseInterface
67+
{
68+
return $this->http->post(Endpoint::bind(Endpoint::GUILD_INTEGRATION_SYNC, $this->vars['guild_id'], $integration_id));
69+
}
4970
}

0 commit comments

Comments
 (0)