diff --git a/packages/bot/src/helpers.ts b/packages/bot/src/helpers.ts index b8028afe0..40420fe43 100644 --- a/packages/bot/src/helpers.ts +++ b/packages/bot/src/helpers.ts @@ -23,6 +23,7 @@ import type { CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, + CreateGuildBan, CreateGuildChannel, CreateGuildEmoji, CreateGuildFromTemplate, @@ -32,13 +33,17 @@ import type { CreateScheduledEvent, CreateStageInstance, CreateTemplate, + DeleteWebhookMessageOptions, DiscordMessage, EditAutoModerationRuleOptions, EditBotMemberOptions, + EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, + EditOwnVoiceState, EditScheduledEvent, + EditUserVoiceState, ExecuteWebhook, GetBans, GetGuildAuditLog, @@ -50,10 +55,13 @@ import type { GetScheduledEvents, GetWebhookMessageOptions, InteractionCallbackData, + InteractionResponse, ListArchivedThreads, ListGuildMembers, + MfaLevels, ModifyChannel, ModifyGuild, + ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyGuildMember, ModifyGuildTemplate, @@ -466,6 +474,145 @@ export function createBotHelpers(bot: Bot): BotHelpers { bot.transformers.member(bot, snakelize(res), guildId, bot.transformers.snowflake(res.user.id)), ) }, + // All useless void return functions here + addReaction: async (channelId, messageId, reaction) => { + return await bot.rest.addReaction(channelId, messageId, reaction) + }, + addReactions: async (channelId, messageId, reactions, ordered) => { + return await bot.rest.addReactions(channelId, messageId, reactions, ordered) + }, + addRole: async (guildId, userId, roleId, reason) => { + return await bot.rest.addRole(guildId, userId, roleId, reason) + }, + addThreadMember: async (channelId, userId) => { + return await bot.rest.addThreadMember(channelId, userId) + }, + deleteAutomodRule: async (guildId, ruleId, reason) => { + return await bot.rest.deleteAutomodRule(guildId, ruleId, reason) + }, + deleteChannel: async (channelId, reason) => { + return await bot.rest.deleteChannel(channelId, reason) + }, + deleteChannelPermissionOverride: async (channelId, overwriteId, reason) => { + return await bot.rest.deleteChannelPermissionOverride(channelId, overwriteId, reason) + }, + deleteEmoji: async (guildId, id, reason) => { + return await bot.rest.deleteEmoji(guildId, id, reason) + }, + deleteFollowupMessage: async (token, messageId) => { + return await bot.rest.deleteFollowupMessage(token, messageId) + }, + deleteGlobalApplicationCommand: async (commandId) => { + return await bot.rest.deleteGlobalApplicationCommand(commandId) + }, + deleteGuild: async (guildId) => { + return await bot.rest.deleteGuild(guildId) + }, + deleteGuildApplicationCommand: async (commandId, guildId) => { + return await bot.rest.deleteGuildApplicationCommand(commandId, guildId) + }, + deleteGuildSticker: async (guildId, stickerId, reason) => { + return await bot.rest.deleteGuildSticker(guildId, stickerId, reason) + }, + deleteGuildTemplate: async (guildId, templateCode) => { + return await bot.rest.deleteGuildTemplate(guildId, templateCode) + }, + deleteIntegration: async (guildId, integrationId, reason) => { + return await bot.rest.deleteIntegration(guildId, integrationId, reason) + }, + deleteInvite: async (inviteCode, reason) => { + return await bot.rest.deleteInvite(inviteCode, reason) + }, + deleteMessage: async (channelId, messageId, reason) => { + return await bot.rest.deleteMessage(channelId, messageId, reason) + }, + deleteMessages: async (channelId, messageIds, reason) => { + return await bot.rest.deleteMessages(channelId, messageIds, reason) + }, + deleteOriginalInteractionResponse: async (token) => { + return await bot.rest.deleteOriginalInteractionResponse(token) + }, + deleteOwnReaction: async (channelId, messageId, reaction) => { + return await bot.rest.deleteOwnReaction(channelId, messageId, reaction) + }, + deleteReactionsAll: async (channelId, messageId) => { + return await bot.rest.deleteReactionsAll(channelId, messageId) + }, + deleteReactionsEmoji: async (channelId, messageId, reaction) => { + return await bot.rest.deleteReactionsEmoji(channelId, messageId, reaction) + }, + deleteRole: async (guildId, roleId, reason) => { + return await bot.rest.deleteRole(guildId, roleId, reason) + }, + deleteScheduledEvent: async (guildId, eventId) => { + return await bot.rest.deleteScheduledEvent(guildId, eventId) + }, + deleteStageInstance: async (channelId, reason) => { + return await bot.rest.deleteStageInstance(channelId, reason) + }, + deleteUserReaction: async (channelId, messageId, userId, reaction) => { + return await bot.rest.deleteUserReaction(channelId, messageId, userId, reaction) + }, + deleteWebhook: async (webhookId, reason) => { + return await bot.rest.deleteWebhook(webhookId, reason) + }, + deleteWebhookMessage: async (webhookId, token, messageId, options) => { + return await bot.rest.deleteWebhookMessage(webhookId, token, messageId, options) + }, + deleteWebhookWithToken: async (webhookId, token) => { + return await bot.rest.deleteWebhookWithToken(webhookId, token) + }, + editChannelPermissionOverrides: async (channelId, options, reason) => { + return await bot.rest.editChannelPermissionOverrides(channelId, options, reason) + }, + editChannelPositions: async (guildId, channelPositions) => { + return await bot.rest.editChannelPositions(guildId, channelPositions) + }, + editGuildMfaLevel: async (guildId, mfaLevel, reason) => { + return await bot.rest.editGuildMfaLevel(guildId, mfaLevel, reason) + }, + editOwnVoiceState: async (guildId, options) => { + return await bot.rest.editOwnVoiceState(guildId, options) + }, + editUserVoiceState: async (guildId, options) => { + return await bot.rest.editUserVoiceState(guildId, options) + }, + joinThread: async (channelId) => { + return await bot.rest.joinThread(channelId) + }, + leaveGuild: async (guildId) => { + return await bot.rest.leaveGuild(guildId) + }, + leaveThread: async (channelId) => { + return await bot.rest.leaveThread(channelId) + }, + removeRole: async (guildId, userId, roleId, reason) => { + return await bot.rest.removeRole(guildId, userId, roleId, reason) + }, + removeThreadMember: async (channelId, userId) => { + return await bot.rest.removeThreadMember(channelId, userId) + }, + sendInteractionResponse: async (interactionId, token, options) => { + return await bot.rest.sendInteractionResponse(interactionId, token, options) + }, + triggerTypingIndicator: async (channelId) => { + return await bot.rest.triggerTypingIndicator(channelId) + }, + banMember: async (guildId, userId, options, reason) => { + return await bot.rest.banMember(guildId, userId, options, reason) + }, + kickMember: async (guildId, userId, reason) => { + return await bot.rest.kickMember(guildId, userId, reason) + }, + pinMessage: async (channelId, messageId, reason) => { + return await bot.rest.pinMessage(channelId, messageId, reason) + }, + unbanMember: async (guildId, userId, reason) => { + return await bot.rest.unbanMember(guildId, userId, reason) + }, + unpinMessage: async (channelId, messageId, reason) => { + return await bot.rest.unpinMessage(channelId, messageId, reason) + }, } } @@ -604,4 +751,51 @@ export interface BotHelpers { getMembers: (guildId: BigString, options: ListGuildMembers) => Promise pruneMembers: (guildId: BigString, options: BeginGuildPrune, reason?: string) => Promise<{ pruned: number | null }> searchMembers: (guildId: BigString, query: string, options?: Omit) => Promise + // functions return Void so dont need any special handling + addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise + addReactions: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise + addRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise + addThreadMember: (channelId: BigString, userId: BigString) => Promise + deleteAutomodRule: (guildId: BigString, ruleId: BigString, reason?: string) => Promise + deleteChannel: (channelId: BigString, reason?: string) => Promise + deleteChannelPermissionOverride: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise + deleteEmoji: (guildId: BigString, id: BigString, reason?: string) => Promise + deleteFollowupMessage: (token: string, messageId: BigString) => Promise + deleteGlobalApplicationCommand: (commandId: BigString) => Promise + deleteGuild: (guildId: BigString) => Promise + deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise + deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise + deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise + deleteIntegration: (guildId: BigString, integrationId: BigString, reason?: string) => Promise + deleteInvite: (inviteCode: string, reason?: string) => Promise + deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise + deleteMessages: (channelId: BigString, messageIds: BigString[], reason?: string) => Promise + deleteOriginalInteractionResponse: (token: string) => Promise + deleteOwnReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise + deleteReactionsAll: (channelId: BigString, messageId: BigString) => Promise + deleteReactionsEmoji: (channelId: BigString, messageId: BigString, reaction: string) => Promise + deleteRole: (guildId: BigString, roleId: BigString, reason?: string) => Promise + deleteScheduledEvent: (guildId: BigString, eventId: BigString) => Promise + deleteStageInstance: (channelId: BigString, reason?: string) => Promise + deleteUserReaction: (channelId: BigString, messageId: BigString, userId: BigString, reaction: string) => Promise + deleteWebhook: (webhookId: BigString, reason?: string) => Promise + deleteWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise + deleteWebhookWithToken: (webhookId: BigString, token: string) => Promise + editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions, reason?: string) => Promise + editChannelPositions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise + editGuildMfaLevel: (guildId: BigString, mfaLevel: MfaLevels, reason?: string) => Promise + editOwnVoiceState: (guildId: BigString, options: EditOwnVoiceState) => Promise + editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise + joinThread: (channelId: BigString) => Promise + leaveGuild: (guildId: BigString) => Promise + leaveThread: (channelId: BigString) => Promise + removeRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise + removeThreadMember: (channelId: BigString, userId: BigString) => Promise + sendInteractionResponse: (interactionId: BigString, token: string, options: InteractionResponse) => Promise + triggerTypingIndicator: (channelId: BigString) => Promise + banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan, reason?: string) => Promise + kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise + pinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise + unbanMember: (guildId: BigString, userId: BigString, reason?: string) => Promise + unpinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise }