BotMine›Developer Docs›Events
Lua Addon SDK
Events
React to ready, message, guild, and component events.
Ready
luadiscord.onReady(function(event) logger.info("Bot ready: " .. event.botName) logger.info("Guilds: " .. event.guildCount) end)
ReadyEvent contains:
botIdbotNameguildCount
Messages
luadiscord.onMessage(function(event) if event.authorIsBot then return end if event.matches("!", "help") then event.reply("Available commands: `/ping`") end end)
MessageEvent includes:
contentauthorIdauthorNamechannelIdmessageIdguildIdmemberreply(content)send(content)delete()addReaction(emoji)hasPermission(permission)
Guild events
luadiscord.onGuildJoin(function(event) logger.info("New guild: " .. event.guildName) end) discord.onGuildLeave(function(event) logger.info("Left guild: " .. event.guildName) end)
Component events
Component events are registered by customId:
luadiscord.onButton("confirm", function(event) event.replyEphemeral("Confirmed.") end) discord.onSelectMenu("role_select", function(event) event.replyEphemeral("Selected: " .. event.values[1]) end) discord.onModalSubmit("feedback", function(event) event.replyEphemeral("Thanks for your feedback.") end)