Skip to content

Commit

Permalink
chore: lol, thx ??? for me missing the 'Async' keyword on asynchronou…
Browse files Browse the repository at this point in the history
…s functions
  • Loading branch information
4x8Matrix committed May 16, 2024
1 parent 312eabe commit 7a14b96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Examples/Development.luau
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ DiscordClient:setVerbose(true)
DiscordClient:on("Ready", function()
print(`🎉🎉 {DiscordClient.discordUser.username} is online! 🎉🎉`)

local guild = DiscordClient:fetchGuildAsync("737382889947136000"):await()
local permissions = DiscordLuau.DiscordPermissions.new()

permissions:addPermission(DiscordLuau.DiscordPermissions.Permissions.UseApplicationCommands)

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

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

DiscordClient.discordApplication:setSlashCommandsAsync({
guild:setSlashCommandsAsync({
slashCommand0, slashCommand1
}):after(function(data)
print("updated, fetching current commands..")
Expand Down
4 changes: 2 additions & 2 deletions Package/Classes/Internal/DiscordGuildMember.luau
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ function DiscordGuildMember.Prototype.unbanAsync(self: DiscordGuildMember)
return self.discordClient.discordGateway:deleteAsync(string.format(DiscordEndpoints.BotRemoveGuildMemberBan, self.guildId, self.user.id)):await()
end

function DiscordGuildMember.Prototype.addRole(self: DiscordGuildMember, roleId: string)
function DiscordGuildMember.Prototype.addRoleAsync(self: DiscordGuildMember, roleId: string)
return self.discordClient.discordGateway:putAsync(string.format(DiscordEndpoints.BotAddGuildMemberRole, self.guildId, self.user.id, roleId)):await()
end

function DiscordGuildMember.Prototype.removeRole(self: DiscordGuildMember, roleId: string)
function DiscordGuildMember.Prototype.removeRoleAsync(self: DiscordGuildMember, roleId: string)
return self.discordClient.discordGateway:deleteAsync(string.format(DiscordEndpoints.BotRemoveGuildMemberRole, self.guildId, self.user.id, roleId)):await()
end

Expand Down

0 comments on commit 7a14b96

Please sign in to comment.