diff --git a/src/Data/DiscordGuild.php b/src/Data/DiscordGuild.php new file mode 100644 index 0000000..8eb63be --- /dev/null +++ b/src/Data/DiscordGuild.php @@ -0,0 +1,16 @@ + diff --git a/src/Discord.php b/src/Discord.php index 7e7e937..3b29cba 100755 --- a/src/Discord.php +++ b/src/Discord.php @@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Http; use Plytas\Discord\Data\DiscordApplicationCommand; use Plytas\Discord\Data\DiscordChannel; +use Plytas\Discord\Data\DiscordGuild; use Plytas\Discord\Data\DiscordInteraction; use Plytas\Discord\Data\DiscordMessage; use Plytas\Discord\Data\DiscordRole; @@ -76,6 +77,11 @@ public function deleteMessage(string $channelId, string $messageId): Response return $this->client->delete("/channels/{$channelId}/messages/{$messageId}"); } + public function getGuild(string $guildId): DiscordGuild + { + return DiscordGuild::from($this->client->get("/guilds/{$guildId}")->json()); + } + /** * @return Collection */ diff --git a/src/Facades/Discord.php b/src/Facades/Discord.php index 1a2b47e..f5493b2 100644 --- a/src/Facades/Discord.php +++ b/src/Facades/Discord.php @@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Facade; use Plytas\Discord\Data\DiscordApplicationCommand; use Plytas\Discord\Data\DiscordChannel; +use Plytas\Discord\Data\DiscordGuild; use Plytas\Discord\Data\DiscordInteraction; use Plytas\Discord\Data\DiscordMessage; use Plytas\Discord\Data\DiscordRole; @@ -18,6 +19,7 @@ * @method static Response createMessage(string $channelId, DiscordMessage $message) * @method static Response updateMessage(string $channelId, string $messageId, DiscordMessage $message) * @method static Response deleteMessage(string $channelId, string $messageId) + * @method static DiscordGuild getGuild(string $guildId) * @method static Collection getChannels(string $guildId) * @method static Collection getRoles(string $guildId) *