Skip to content

Commit

Permalink
bugfix: add 'putAsync' method call
Browse files Browse the repository at this point in the history
  • Loading branch information
4x8Matrix committed May 17, 2024
1 parent 7a14b96 commit f5df48e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Examples/Development.luau
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,24 @@ DiscordClient:on("Ready", function()
permissions:addPermission(DiscordLuau.DiscordPermissions.Permissions.UseApplicationCommands)

local slashCommand0 = DiscordLuau.ApplicationCommand.new()
:setName("example-1")
:setName("server-0")
:setDescription("...")
:setGuildPermissions(permissions)
:addContext(DiscordLuau.ApplicationCommand.Context.Guild)
:setType(DiscordLuau.ApplicationCommand.Type.ChatInput)

local slashCommand1 = DiscordLuau.ApplicationCommand.new()
:setName("example-2-server")
:setName("server-1")
:setDescription("abc!")
:setGuildPermissions(permissions)
:addContext(DiscordLuau.ApplicationCommand.Context.Guild)
:setType(DiscordLuau.ApplicationCommand.Type.ChatInput)
:addOption(
DiscordLuau.ApplicationCommandOption.new()
:setType(DiscordLuau.ApplicationCommandOption.Type.SubCommand)
:setName("example")
:setDescription("hello, example, this is really just a sub command.")
)

guild:setSlashCommandsAsync({
slashCommand0, slashCommand1
Expand Down
4 changes: 4 additions & 0 deletions Package/Classes/Network/DiscordGateway.luau
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ function DiscordGateway.Prototype.postAsync(self: DiscordGateway, api: string, d
return self:requestAsync(api, "POST", data)
end

function DiscordGateway.Prototype.putAsync(self: DiscordGateway, api: string, data: { [any]: any })
return self:requestAsync(api, "PUT", data)
end

function DiscordGateway.Prototype.deleteAsync(self: DiscordGateway, api: string, data: { [any]: any })
return self:requestAsync(api, "DELETE", data)
end
Expand Down

0 comments on commit f5df48e

Please sign in to comment.