Skip to content

Commit

Permalink
feature: fix discord channel invites
Browse files Browse the repository at this point in the history
  • Loading branch information
4x8Matrix committed May 17, 2024
1 parent f5df48e commit b446c75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Package/Classes/Internal/DiscordChannel.luau
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ end

function DiscordChannel.Prototype.getInvitesAsync(self: DiscordChannel)
return Future.try(function()
local invites = self.discordClient.discordGateway:getAsync(string.format(DiscordEndpoints.BotGetInvites, self.id), { }):await()
local invites = self.discordClient.discordGateway:getAsync(
string.format(DiscordEndpoints.BotGetInvites, self.id)
):await()

for index, inviteData in invites do
invites[index] = DiscordInvite.new(self.discordClient, inviteData)
Expand All @@ -91,7 +93,7 @@ end

function DiscordChannel.Prototype.createInviteAsync(self: DiscordChannel, maxAge: number?, maxUses: number?, temporary: boolean?)
return Future.try(function()
local inviteData = self.discordClient.discordGateway:getAsync(string.format(DiscordEndpoints.BotGetInvites, self.id), {
local inviteData = self.discordClient.discordGateway:postAsync(string.format(DiscordEndpoints.BotGetInvites, self.id), {
max_age = maxAge,
max_uses = maxUses,
temporary = temporary
Expand Down

0 comments on commit b446c75

Please sign in to comment.