diff --git a/Package/Classes/Internal/DiscordGuildMember.luau b/Package/Classes/Internal/DiscordGuildMember.luau index 98adc81..f20320b 100644 --- a/Package/Classes/Internal/DiscordGuildMember.luau +++ b/Package/Classes/Internal/DiscordGuildMember.luau @@ -20,6 +20,16 @@ DiscordGuildMember.Interface = {} DiscordGuildMember.Prototype.type = "DiscordGuildMember" +function DiscordGuildMember.Prototype.kickAsync(self: DiscordGuildMember, deleteMessagesSeconds: number?) + return self.discordClient.discordGateway:putAsync(string.format(DiscordEndpoints.BotBanGuildMember, self.guildId, self.user.id), { + delete_message_seconds = deleteMessagesSeconds or 0 + }):await() +end + +function DiscordGuildMember.Prototype.banAsync(self: DiscordGuildMember, deleteMessagesSeconds: number?) + return self.discordClient.discordGateway:deleteAsync(string.format(DiscordEndpoints.BotRemoveGuildMember, self.guildId, self.user.id)):await() +end + function DiscordGuildMember.Interface.new(discordClient: any, userId: string, guildId: string, memberData: { [any]: any }) local self = discordClient.discordCache:getDataOr(CacheType.DiscordMember, `{guildId}-{userId}`, function() return Construct({ @@ -31,6 +41,8 @@ function DiscordGuildMember.Interface.new(discordClient: any, userId: string, gu memberData.user = DiscordUser.new(self.discordClient, memberData.user) end + memberData.guildId = guildId + for index, value in memberData do self[index] = value end @@ -40,7 +52,8 @@ end export type DiscordGuildMember = typeof(DiscordGuildMember.Prototype) & { discordClient: any, - code: string, + user: DiscordUser.DiscordUser, + guildId: number, } return DiscordGuildMember.Interface \ No newline at end of file diff --git a/Package/Enums/DiscordEndpoints.luau b/Package/Enums/DiscordEndpoints.luau index 1d31aa5..180133d 100644 --- a/Package/Enums/DiscordEndpoints.luau +++ b/Package/Enums/DiscordEndpoints.luau @@ -42,6 +42,8 @@ return { BotGetGuildChannels = "guilds/%s/channels", BotGetGuildMember = "guilds/%s/members/%s", BotGetGuildMembers = "guilds/%s/members?limit=%s&after=%s", + BotBanGuildMember = "guilds/%s/members/%s", + BotRemoveGuildMember = "guilds/%s/members/%s", BotSearchGuildMembers = "guilds/%s/members/search?query=%s&limit=%s", BotModifyGuildChannelPosition = "channels/%s/channels",