{"id":"horsenuggets/discord-luau","name":"discord-luau","scope":"horsenuggets","platform":"roblox","description":"A comprehensive Discord API library for Luau, inspired by discord.js.","version":"0.1.9","latest":"0.1.9","versions":["0.0.1","0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7","0.1.8","0.1.9"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"horsenuggets/t":{"version":"^3.1.1-horse.0.3","alias":"t"}},"integrity":"f1cadc1c45d14b070e29c49d2bb0f206257243cb7eccfc83e75bbacdfcffa8f3","likes":0,"downloads":0,"install":"forest install horsenuggets/discord-luau","url":"https://forest.dev/p/roblox/horsenuggets/discord-luau","files":"https://api.forest.dev/ai/package/roblox/horsenuggets/discord-luau/files","readme":"# discord-luau\n\nA comprehensive Discord API library for Luau, inspired by discord.js.\n\n## Installation\n\nAdd to your `wally.toml`:\n\n```toml\n[dependencies]\nDiscord = \"horsenuggets/discord-luau@0.1.9\"\n```\n\n## Quick Start\n\n```luau\nlocal Discord = require(\"@packages/Discord\")\nlocal process = require(\"@lune/process\")\n\n-- Create a client with intents\nlocal client = Discord.Client.new({\n    intents = {\n        Discord.Intents.Guilds,\n        Discord.Intents.GuildMessages,\n        Discord.Intents.MessageContent,\n    },\n})\n\n-- Listen for ready event\nclient:On(\"ready\", function()\n    print(`Logged in as {client.User:GetTag()}!`)\nend)\n\n-- Listen for messages\nclient:On(\"messageCreate\", function(message)\n    if message.Content == \"!ping\" then\n        message:Reply(\"Pong!\")\n    end\nend)\n\n-- Login with your bot token\nclient:Login(process.env.DISCORD_BOT_TOKEN)\n```\n\n## Slash Commands\n\n```luau\nlocal Discord = require(\"@packages/Discord\")\nlocal process = require(\"@lune/process\")\n\nlocal client = Discord.Client.new({\n    intents = { Discord.Intents.Guilds },\n})\n\n-- Register commands when ready\nclient:On(\"ready\", function()\n    -- Create a slash command using the builder\n    local pingCommand = Discord.SlashCommandBuilder.new()\n        :SetName(\"ping\")\n        :SetDescription(\"Check bot latency\")\n\n    local echoCommand = Discord.SlashCommandBuilder.new()\n        :SetName(\"echo\")\n        :SetDescription(\"Echo a message\")\n        :AddStringOption(\"message\", \"The message to echo\", { required = true })\n\n    -- Register commands globally\n    client:SetGlobalCommands({ pingCommand, echoCommand })\n    print(\"Commands registered!\")\nend)\n\n-- Handle interactions\nclient:On(\"interactionCreate\", function(interaction)\n    if not interaction:IsCommand() then\n        return\n    end\n\n    if interaction.CommandName == \"ping\" then\n        interaction:Reply(\"Pong!\")\n    elseif interaction.CommandName == \"echo\" then\n        local message = interaction:GetOption(\"message\")\n        interaction:Reply(message)\n    end\nend)\n\nclient:Login(process.env.DISCORD_BOT_TOKEN)\n```\n\n## Embeds\n\n```luau\nlocal Discord = require(\"@packages/Discord\")\n\nlocal embed = Discord.Embed.new()\n    :SetTitle(\"Hello World\")\n    :SetDescription(\"This is an embed!\")\n    :SetColor(0x5865F2)\n    :AddField(\"Field 1\", \"Value 1\", true)\n    :AddField(\"Field 2\", \"Value 2\", true)\n    :SetFooter(\"Footer text\")\n    :SetTimestamp()\n\n-- Send embed with a message\nmessage:Reply({ embeds = { embed:ToJSON() } })\n\n-- Or in an interaction\ninteraction:Reply({ embeds = { embed:ToJSON() } })\n```\n\n## Features\n\n- Full Discord Gateway v10 support\n- REST API for all Discord endpoints\n- Event-driven architecture\n- Comprehensive type definitions\n- Slash commands and interactions\n- Message components (buttons, select menus)\n- Reactions and embeds\n- Guild, channel, and user management\n- Permission handling\n- Rate limiting\n\n## Events\n\nThe client emits the following events:\n\n- `ready` - Bot is connected and ready\n- `messageCreate` - New message received\n- `messageUpdate` - Message was edited\n- `messageDelete` - Message was deleted\n- `interactionCreate` - Slash command or component interaction\n- `guildCreate` - Bot joined a guild\n- `guildDelete` - Bot left a guild\n- `guildMemberAdd` - Member joined a guild\n- `guildMemberRemove` - Member left a guild\n- `channelCreate` - Channel was created\n- `channelUpdate` - Channel was updated\n- `channelDelete` - Channel was deleted\n- `messageReactionAdd` - Reaction added to a message\n- `messageReactionRemove` - Reaction removed from a message\n- `typingStart` - User started typing\n- `voiceStateUpdate` - Voice state changed\n- `presenceUpdate` - Presence changed\n","readmeTruncated":false}