repo stringclasses 350
values | file_path stringlengths 29 200 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.01M | tokens int64 2 598k |
|---|---|---|---|---|---|
sircfenner/png-luau | sircfenner-png-luau-d9f8f3b/src/zlib.luau | luau | .luau | --!native
--!optimize 2
local MAX_BITS = 15
-- stylua: ignore
local LIT_LEN = {
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131,
163, 195, 227, 258
}
-- stylua: ignore
local LIT_EXTRA = {
1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0,
}
-- stylua: ign... | 5,577 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.eryx/typedefs/_ffi.luau | luau | .luau | return {} :: any
| 5 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.nvim.lua | luau | .lua | require("@self/luau-lsp").config({
server = {
settings = {
["luau-lsp"] = {
inlayHints = {
variableTypes = true,
functionReturnTypes = true,
parameterNames = "all",
typeHintMaxLength = 20,
},
require = {
mode = "relativeToFile",
directoryAliases = {},
},
completio... | 130 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/analyze.luau | luau | .luau | --> Task to typecheck packages using luau-lsp
local task = require("./task")
task.new("luau-lsp")
:addArgument("analyze")
:addArgument("--base-luaurc=.luaurc")
:addArgument("--settings=.vscode/settings.json")
:addArgument("--defs=globalTypes.d.luau")
:addArgument("--defs=.zune/zune.d.luau")
:addArgument("--igno... | 157 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/bundle.luau | luau | .luau | --> Task to typecheck packages using luau-lsp
local task = require("./task")
task.new("pesde"):addArgument("install"):setcwd("packages/api_types"):execute()
task.new("zune"):addArgument("run"):addArgument(".zune/bundle.luau"):setcwd("packages/api_types"):execute()
| 69 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/fmt.luau | luau | .luau | --> Task to execute StyLua for checking validity of formatting
local task = require("./task")
task.new("stylua")
:addArgument("--check")
:addArgument("--output-format")
:addArgument("Summary")
:addArgument("packages")
:execute()
| 54 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/lint.luau | luau | .luau | --> Task for linting packages using selene
local task = require("./task")
task.new("selene"):addArgument("packages"):execute()
| 30 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/publish.luau | luau | .luau | --> Publishes all non-private workspace packages to the pesde registry with rate limit retry handling.
local PACKAGES_DIR = "packages"
local PUBLISH_DELAY = 10
local MAX_RETRIES = 5
local entries = zune.fs.entries(PACKAGES_DIR)
local publishable: { string } = {}
local function isPrivate(packageDirectory: string): bo... | 649 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/script.luau | luau | .luau | --> run a script, scripts can be found under .zune/scripts
local task = require("./task")
local processArguments = table.clone(zune.process.args)
table.remove(processArguments, 1)
local scriptName = table.remove(processArguments, 1)
local scriptPath = `.zune/scripts/{scriptName}.luau`
local ok, stat = pcall(zune.fs.... | 149 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/scripts/countAliases.luau | luau | .luau | local packageDir = zune.process.args[2]
local function patchFile(dir, fileName)
local fileData = zune.fs.readFile(`{dir}/{fileName}`)
for requirePath: string in fileData.gmatch(fileData, 'local %S+ = require%("(%S+)"%)') do
if string.sub(requirePath, 1, 1) == "@" then
print(`{dir}/{fileName}`)
end
end
end
... | 171 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/scripts/fsIntoTable.luau | luau | .luau | local luaTableSource = "{\n"
local packageDir = zune.process.args[2]
local function readFile(dir, fileName)
local fileName = string.sub(fileName, 1, -6)
local source = `{dir}/{fileName}`
luaTableSource = `local {fileName} = require("{string.gsub(source, packageDir .. "/", "")}")\n` .. luaTableSource
luaTableSourc... | 253 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/task/init.luau | luau | .luau | --> An internal library for zune scripts to execute tasks in CI/CD
local Task = {}
Task.Prototype = {}
Task.Interface = {}
function Task.Prototype.addArgument(self: Task, argument: string): Task
table.insert(self.arguments, argument)
return self
end
function Task.Prototype.setcwd(self: Task, cwd: string): Task
... | 266 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/task/requireTests.luau | luau | .luau | local requireTests
local requireFile
function requireFile(fullPath: string)
local path = string.split(fullPath, `/`)
local fileName = string.match(table.remove(path, #path) :: string, "^(.*)%.spec%.luau$")
table.remove(path, 1)
local success, result = pcall(require, `../../{table.concat(path, `/`)}/{fileName}.sp... | 271 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/.zune/test.luau | luau | .luau | local frktest = require("../luau_packages/frktest")
local reporter = frktest.reporters.console_reporter
local requireTests = require("./task/requireTests")
requireTests("./packages")
reporter.init()
local testModule = frktest.test
local suiteName = ""
local suitePassed = 0
local suiteFailed = 0
local suiteSkipped ... | 384 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/globalTypes.d.luau | luau | .luau | declare function warn<T...>(...: T...)
declare game: any
declare workspace: any
declare task: any
declare Enum: any
declare DateTime: any
declare HttpService: any
| 41 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/accumulator/src/init.luau | luau | .luau | --[=[
@class Accumulator
@__index Prototype
An accumulator is a data structure that collects data written to it in a sequential manner,
only exposing that data once it has been completely written.
It is used in the Discord Websocket to ensure that we receive an entire ZLib compressed
message before we attempt t... | 355 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/.zune/bundle.luau | luau | .luau | --> Task to execute Darklua for bundling the various packages apart of Discord-Luau
local task = require("../../../.zune/task")
task.new("darklua")
:addArgument("process")
:addArgument("src/init.luau")
:addArgument("bundled.luau")
:addArgument(`-cdarklua.json`)
:execute()
task.new("stylua"):addArgument("bundled... | 133 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/application.luau | luau | .luau | --[=[
@class Types.application
]=]
local util = require("../luau_packages/util")
local MembershipState = table.freeze(util.tableReflect({
Invited = 1,
Accepted = 2,
}))
local IntegrationTypesConfig = table.freeze(util.tableReflect({
GuildInstall = 0,
UserInstall = 1,
}))
local ApplicationRoleConnectionMetadata... | 477 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/channel.luau | luau | .luau | --[=[
@class Types.channel
]=]
local util = require("../luau_packages/util")
local apiTypes = require("./apiTypes")
local ChannelTypes = table.freeze(util.tableReflect({
GuildText = 0,
DM = 1,
GuildVoice = 2,
GroupDM = 3,
GuildCategory = 4,
GuildAnnouncement = 5,
AnnouncementThread = 10,
PublicThread = 11,
... | 790 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/client.luau | luau | .luau | --[=[
@class Types.client
]=]
local util = require("../luau_packages/util")
local ActivityType = table.freeze(util.tableReflect({
Game = 0,
Streaming = 1,
Listening = 2,
Watching = 3,
Competing = 5,
}))
local Status = table.freeze(util.tableReflect({
Online = "online",
DoNotDisturb = "dnd",
Idle = "idle",
... | 170 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/embed.luau | luau | .luau | --[=[
@class Types.embed
]=]
local util = require("../luau_packages/util")
local EmbedType = table.freeze(util.tableReflect({
Rich = "rich",
Image = "image",
Video = "video",
Gifv = "gifv",
Article = "article",
Link = "link",
PollResult = "poll_result",
}))
export type EmbedType = "Rich" | "Image" | "Video" ... | 120 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/entitlement.luau | luau | .luau | --[=[
@class Types.entitlement
]=]
local util = require("../luau_packages/util")
local EntitlementType = table.freeze(util.tableReflect({
Purchase = 1,
PremiumSubscription = 2,
DeveloperGift = 3,
TestModePurchase = 4,
FreePurchase = 5,
UserGift = 6,
PremiumPurchase = 7,
ApplicationSubscription = 8,
}))
loca... | 199 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/gateway/closeCodes.luau | luau | .luau | --[=[
@class Types.gateway.closeCodes
https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
]=]
local CloseCodes = table.freeze({
UnknownError = 4000,
UnknownOpcode = 4001,
DecodeError = 4002,
NotAuthenticated = 4003,
AuthenticationFailed = 4004,
AlreadyAuthenti... | 263 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/gateway/intents.luau | luau | .luau | --[=[
@class Types.gateway.intents
https://discord.com/developers/docs/topics/gateway#list-of-intents
]=]
local Intents = table.freeze({
Guilds = 0,
GuildMembers = 1,
GuildModeration = 2,
GuildEmojisAndStickers = 3,
GuildIntegrations = 4,
GuildWebhooks = 5,
GuildInvites = 6,
GuildVoiceStates = 7,
GuildPres... | 371 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/gateway/opcodes.luau | luau | .luau | --[=[
@class Types.gateway.opcodes
https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
]=]
local Opcodes = table.freeze({
Dispatch = 0,
Heartbeat = 1,
Identify = 2,
PresenceUpdate = 3,
VoiceStateUpdate = 4,
Resume = 6,
Reconnect = 7,
RequestGuildMembers = 8,
InvalidS... | 191 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/gateway/receiveEvents.luau | luau | .luau | --[=[
@class Types.gateway.receiveEvents
https://discord.com/developers/docs/topics/gateway-events#receive-events
these enums map to the `T` event name given in a Discord payload;
https://discord.com/developers/docs/topics/gateway-events#payload-structure
]=]
local ReceiveEvents = table.freeze({
Hello = "HELL... | 1,447 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/gateway/sendEvents.luau | luau | .luau | --[=[
@class Types.gateway.sendEvents
https://discord.com/developers/docs/topics/gateway-events#send-events
these enums map to the `opcodes` module under `@api-types/gateway/optcodes.luau`
]=]
local SendEvents = table.freeze({
Identify = "Identify",
Resume = "Resume",
Heartbeat = "Heartbeat",
RequestGuildMemb... | 144 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/guild.luau | luau | .luau | --[=[
@class Types.guild
]=]
local util = require("../luau_packages/util")
local VerificationLevel = table.freeze(util.tableReflect({
None = 0,
Low = 1,
Medium = 2,
High = 3,
VeryHigh = 4,
}))
local DefaultMessageNotification = table.freeze(util.tableReflect({
AllMessages = 0,
OnlyMentions = 1,
}))
local Ex... | 2,611 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/interaction.luau | luau | .luau | --[=[
@class Types.interaction
]=]
local util = require("../luau_packages/util")
local InteractionType = table.freeze(util.tableReflect({
Ping = 1,
ApplicationCommand = 2,
MessageComponent = 3,
ApplicationCommandAutocomplete = 4,
ModalSubmit = 5,
}))
local ApplicationCommandOptionType = table.freeze(util.table... | 652 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/permission.luau | luau | .luau | --[=[
@class Types.permission
]=]
local util = require("../luau_packages/util")
local bit = require("../luau_packages/bit")
local Permissions = table.freeze(util.tableReflect({
CreateInstantInvite = bit.lshift("1", 0),
KickMembers = bit.lshift("1", 1),
BanMembers = bit.lshift("1", 2),
Administrator = bit.lshift... | 1,071 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/poll.luau | luau | .luau | --[=[
@class Types.poll
]=]
export type PollLayoutType = "Default"
return "DISCORD_V10_APPLICATION_TYPES"
| 27 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/sticker.luau | luau | .luau | --[=[
@class Types.sticker
]=]
local util = require("../luau_packages/util")
local StickerTypes = table.freeze(util.tableReflect({
Standard = 1,
Guild = 2,
}))
local StickerFormatTypes = table.freeze(util.tableReflect({
PNG = 1,
APNG = 2,
LOTTIE = 3,
GIF = 4,
}))
export type StickerType = "Standard" | "Guild... | 150 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/user.luau | luau | .luau | --[=[
@class Types.user
]=]
local util = require("../luau_packages/util")
local NitroType = table.freeze(util.tableReflect({
None = 0,
NitroClassic = 1,
Nitro = 2,
NitroBasic = 3,
}))
export type NitroType = "None" | "NitroClassic" | "Nitro" | "NitroBasic"
return {
NitroType = NitroType,
}
| 97 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/voice/closeCodes.luau | luau | .luau | --[=[
@class Types.voice.closeCodes
https://discord.com/developers/docs/topics/voice-connections#opcodes-and-status-codes-voice-close-event-codes
]=]
local CloseCodes = table.freeze({
UnknownOpcode = 4001,
FailedToDecodePayload = 4002,
NotAuthenticated = 4003,
AuthenticationFailed = 4004,
AlreadyAuthenticated ... | 296 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/voice/opcodes.luau | luau | .luau | --[=[
@class Types.voice.opcodes
https://discord.com/developers/docs/topics/voice-connections#opcodes-and-status-codes
]=]
local Opcodes = table.freeze({
Identify = 0,
SelectProtocol = 1,
Ready = 2,
Heartbeat = 3,
SessionDescription = 4,
Speaking = 5,
HeartbeatACK = 6,
Resume = 7,
Hello = 8,
Resumed = 9,
... | 497 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/api_types/src/webhook.luau | luau | .luau | --[=[
@class Types.webhook
]=]
local util = require("../luau_packages/util")
local WebhookType = table.freeze(util.tableReflect({
Incoming = 1,
ChannelFollower = 2,
Application = 3,
}))
export type WebhookType = "Incoming" | "ChannelFollower" | "Application"
return {
WebhookType = WebhookType,
}
| 82 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/bit/src/init.luau | luau | .luau | --[=[
@class Bit
A Bit wrapper library that supports 64-bit integers represented as decimal strings.
Primarily required in the calculation for snowflake IDs that the Discord API will give us.
]=]
local int64 = require("@self/../luau_packages/int64")
local Bit = {}
--[=[
@within Bit
Binary NOT operation for in... | 414 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/activity.luau | luau | .luau | --[=[
@class Builders.Activity
@__index Prototype
Implementation of Discord Activity as a Luau builder.
https://discord.com/developers/docs/events/gateway-events#activity-object
Note: Only YouTube and Twitch URLs are allowed for streaming.
]=]
--[=[
@prop name string
@within Builders.Activity
The name of t... | 750 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/application/roleConnectionMetadata.luau | luau | .luau | --[=[
@class Builders.ApplicationRoleConnectionMetadata
@__index Prototype
Implementation of Discord's Application Role Connection Metadata object as a Luau builder.
https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object
]=]
local apiTypes =... | 887 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/automoderation/rule.luau | luau | .luau | --[=[
@class Builders.AutoModeration.Rule
@__index Prototype
Implementation of a discord automoderation rule object as a luau builder.
https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
]=]
--[=[
@prop name string
@within Builders.AutoModeration.Rule
The name of the auto... | 1,538 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/entitlement/testEntitlement.luau | luau | .luau | --[=[
@class Builders.TestEntitlement
@__index Prototype
Implementation of Discord's Create Test Entitlement params as a Luau builder.
https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement-json-params
]=]
local apiTypes = require("../../luau_packages/api_types")
local TestEntitle... | 515 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/guild/ban.luau | luau | .luau | --[=[
@class Builders.GuildBan
@__index Prototype
Implementation of Discord's Create Guild Ban params as a Luau builder.
https://discord.com/developers/docs/resources/guild#create-guild-ban-json-params
]=]
local GuildBan = {}
GuildBan.Prototype = {}
GuildBan.Interface = {}
function GuildBan.Prototype.setDelete... | 269 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/guild/channelPosition.luau | luau | .luau | --[=[
@class Builders.ChannelPosition
@__index Prototype
Implementation of Discord's Modify Guild Channel Positions params as a Luau builder.
https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions-json-params
]=]
local ChannelPosition = {}
ChannelPosition.Prototype = {}
ChannelPositi... | 435 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/guild/member.luau | luau | .luau | --[=[
@class Builders.GuildMember
@__index Prototype
Implementation of Discord's Modify Guild Member params as a Luau builder.
https://discord.com/developers/docs/resources/guild#modify-guild-member-json-params
]=]
local GuildMember = {}
GuildMember.Prototype = {}
GuildMember.Interface = {}
function GuildMembe... | 650 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/guild/prune.luau | luau | .luau | --[=[
@class Builders.GuildPrune
@__index Prototype
Implementation of Discord's Begin Guild Prune params as a Luau builder.
https://discord.com/developers/docs/resources/guild#begin-guild-prune-json-params
]=]
local GuildPrune = {}
GuildPrune.Prototype = {}
GuildPrune.Interface = {}
function GuildPrune.Prototy... | 439 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/guild/scheduledEvent.luau | luau | .luau | --[=[
@class Builders.GuildScheduledEvent
@__index Prototype
Implementation of Discord's Guild Scheduled Event create/modify params as a Luau builder.
https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event-json-params
]=]
local apiTypes = require("../../luau_packages/api... | 1,233 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/guild/scheduledEventRecurrenceRule.luau | luau | .luau | --[=[
@class Builders.GuildScheduledEventRecurrenceRule
@__index Prototype
Implementation of Discord's Guild Scheduled Event Recurrence Rule object as a Luau builder.
https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object
]=]
local apiTypes = require("../... | 1,310 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/guild/stageInstance.luau | luau | .luau | --[=[
@class Builders.StageInstance
@__index Prototype
Implementation of Discord's Create Stage Instance params as a Luau builder.
https://discord.com/developers/docs/resources/stage-instance#create-stage-instance-json-params
]=]
local apiTypes = require("../../luau_packages/api_types")
local StageInstance = {}... | 664 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/init.luau | luau | .luau | local provider = require("@self/embed/provider")
local field = require("@self/embed/field")
local thumbnail = require("@self/embed/thumbnail")
local embed = require("@self/embed/embed")
local author = require("@self/embed/author")
local image = require("@self/embed/image")
local footer = require("@self/embed/footer")
l... | 2,277 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/message/editMessage.luau | luau | .luau | --[=[
@class Builders.EditMessage
@__index Prototype
Implementation of Discord's Edit Message params as a Luau builder.
https://discord.com/developers/docs/resources/message#edit-message-jsonform-params
]=]
local embed = require("../embed/embed")
local allowedMention = require("./allowedMention")
local EditMess... | 853 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/presence.luau | luau | .luau | --[=[
@class Builders.Presence
@__index Prototype
Implementation of a Discord Presence as a Luau builder.
https://discord.com/developers/docs/events/gateway-events#update-presence
]=]
--[=[
@prop activities { Classes.Activity }
@within Builders.Presence
An array of activity objects that represent what the cl... | 788 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/voice/updateVoiceState.luau | luau | .luau | --[=[
@class Builders.UpdateVoiceState
@__index Prototype
Implementation of Discord's Gateway Update Voice State (Op 4) payload as a Luau builder.
https://discord.com/developers/docs/topics/gateway-events#update-voice-state
]=]
local UpdateVoiceState = {}
UpdateVoiceState.Prototype = {}
UpdateVoiceState.Interfa... | 555 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/webhook/executeWebhook.luau | luau | .luau | --[=[
@class Builders.ExecuteWebhook
@__index Prototype
Implementation of Discord's Execute Webhook params as a Luau builder.
https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params
]=]
local embed = require("../embed/embed")
local allowedMention = require("../message/allowedMention... | 1,363 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/builders/src/webhook/webhook.luau | luau | .luau | --[=[
@class Builders.Webhook
@__index Prototype
Implementation of Discord's Create/Modify Webhook params as a Luau builder.
https://discord.com/developers/docs/resources/webhook#create-webhook-json-params
]=]
local Webhook = {}
Webhook.Prototype = {}
Webhook.Interface = {}
function Webhook.Prototype.setName(s... | 345 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/classes/src/application/sku.luau | luau | .luau | --[=[
@class Classes.Application.Sku
@__index Prototype
Implementation of the Discord SKU class in Luau.
https://discord.com/developers/docs/monetization/skus#sku-object
]=]
--[=[
@prop id string
@within Classes.Application.Sku
]=]
--[=[
@prop type number
@within Classes.Application.Sku
]=]
--[=[
@prop ap... | 377 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/classes/src/bitflags/application.luau | luau | .luau | --[=[
@class Classes.ApplicationBitflag
@__index Prototype
Implementation of the Discord Application Bitflags in Luau.
This class provides methods to check various application flags that indicate different states and capabilities of a Discord application.
https://discord.com/developers/docs/resources/application... | 995 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/classes/src/channels/construct.luau | luau | .luau | -- selene: allow(unused_variable)
local state = require("../../luau_packages/state")
local apiTypes = require("../../luau_packages/api_types")
local dmChannel = require("./types/dm")
local groupDmChannel = require("./types/groupDm")
local guildAnnouncement = require("./types/guildAnnouncement")
local guildCategory = r... | 568 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/classes/src/init.luau | luau | .luau | local provider = require("@self/embed/provider")
local field = require("@self/embed/field")
local thumbnail = require("@self/embed/thumbnail")
local embed = require("@self/embed/embed")
local author = require("@self/embed/author")
local image = require("@self/embed/image")
local footer = require("@self/embed/footer")
l... | 3,802 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/commands/src/command.luau | luau | .luau | --[=[
@class Commands.Command
Shared type definitions for the commands framework.
]=]
local apiTypes = require("../luau_packages/api_types")
local builders = require("../luau_packages/builders")
local classes = require("../luau_packages/classes")
export type TransformFunction = (value: any, interaction: classes.Ty... | 559 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/commands/src/cooldown.luau | luau | .luau | --[=[
@class Commands.Cooldown
Pure utility functions for cooldown and concurrency state management.
]=]
local classes = require("../luau_packages/classes")
local command = require("./command")
local function resolveInteractionUserId(interaction: classes.TypesCommand): string
if interaction.user then
return in... | 960 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/commands/src/guards.luau | luau | .luau | --[=[
@class Commands.Guards
Built-in guards for common access control patterns.
]=]
local classes = require("../luau_packages/classes")
local Guards = {}
--[=[
@within Commands.Guards
Returns true if the interaction was invoked inside a guild.
]=]
function Guards.guildOnly(interaction: classes.TypesCommand): ... | 282 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/commands/src/loader.luau | luau | .luau | --[=[
@class Commands.Loader
@__index Prototype
Loads command modules from a directory tree and supports hot-reload via file watching.
]=]
--[=[
@prop registry registry.Registry
@within Commands.Loader
]=]
--[=[
@prop logger logger.Logger
@within Commands.Loader
]=]
--[=[
@prop context any
@within Commands... | 2,074 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/commands/src/registry.luau | luau | .luau | --[=[
@class Commands.Registry
@__index Prototype
In-memory store mapping command names to their definitions.
]=]
--[=[
@prop commands { [string]: command.CommandDefinition }
@within Commands.Registry
]=]
local command = require("./command")
local Registry = {}
Registry.Interface = {}
Registry.Prototype = {}
... | 344 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/commands/create.luau | luau | .luau | local CliBuilder = require("../../luau_packages/cli_builder")
local StdPolyfills = require("../../luau_packages/std_polyfills")
local Logger = require("../objects/logger")
local command = CliBuilder.command
local OS_SLASH_MAP = table.freeze({
["linux"] = "/",
["macos"] = "/",
["windows"] = "\\",
})
local OS_HOME... | 1,844 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/objects/logger.luau | luau | .luau | local logger = require("../../luau_packages/logger")
return logger.new("DiscordLuau/create_app")
| 21 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/env_file.luau | luau | .luau | return function(discordToken: string)
return `return \{\n\tDISCORD_BOT_TOKEN = "{discordToken}"\n}\n`
end
| 33 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/git_attributes.luau | luau | .luau | return function()
return [[*.patch text eol=lf]]
end
| 15 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/gitignore.luau | luau | .luau | return function()
return [[# Environment - contains secrets, do not commit
.env.luau
# Dependency directories
luau_packages/
lune_packages/
]]
end
| 34 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/init_src.luau | luau | .luau | return function()
return [[local discord = require("@self/../luau_packages/discord")
local classes = require("@self/../luau_packages/classes")
local builders = require("@self/../luau_packages/builders")
local env = require("@self/../.env")
local DISCORD_BOT_INTENTS = builders.intents
.new({
"Guilds",
"GuildMess... | 190 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/luau_rc.luau | luau | .luau | local StdPolyfills = require("../../../luau_packages/std_polyfills")
local RUNTIME_ALIASES = {
lune = { lune = "~/.lune/.typedefs/0.10.1/" },
zune = { zune = "~/.zune/typedefs/" },
lute = { lute = "~/.lute/typedefs/lute/", std = "~/.lute/typedefs/std/" },
}
return function(runtime: string)
return StdPolyfills.ser... | 138 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/pesde_future_patch.luau | luau | .luau | return function()
local lines = {
"diff --git a/src/init.luau b/src/init.luau",
"index 1eaba03..94a8070 100644",
"--- a/src/init.luau",
"+++ b/src/init.luau",
"@@ -1,10 +1,10 @@",
'-local Poll = require("./Poll")\r',
'+local Poll = require("@self/Poll")\r',
" export type Poll<E, U...> = Poll.Poll<E, U.... | 283 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/pesde_sha256_patch.luau | luau | .luau | return function()
local lines = {
"diff --git a/init.luau b/init.luau",
"index 0ab7093..30328fa 100644",
"--- a/init.luau",
"+++ b/init.luau",
"@@ -131,33 +131,8 @@ function sha256.update(self, message)",
" i = self.start\r",
" while index < length and i < 64 do\r",
" ... | 1,052 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/rokit_toml.luau | luau | .luau | local StdPolyfills = require("../../../luau_packages/std_polyfills")
local RUNTIME_TOOLS = {
zune = "Scythe-Technology/zune@0.5.6",
lune = "lune-org/lune@0.10.4",
lute = "luau-lang/lute@^1.0.0",
}
return function(runtime: string)
local tools = {
lune = RUNTIME_TOOLS.lune,
}
if runtime ~= "lune" then
tools[... | 141 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/selene_toml.luau | luau | .luau | return function(runtime: string)
local std = if string.lower(runtime) == "zune" then "luau+zune" else "luau"
return `std = "{std}"\n`
.. [[
[lints]
high_cyclomatic_complexity = "allow"
if_same_then_else = "allow"
shadowing = "allow"
]]
end
| 77 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/vscode_settings.luau | luau | .luau | local StdPolyfills = require("../../../luau_packages/std_polyfills")
return function(runtime: string)
local settings: { [string]: any } = {
["editor.formatOnSave"] = true,
["luau-lsp.inlayHints.variableTypes"] = true,
["luau-lsp.inlayHints.functionReturnTypes"] = true,
["luau-lsp.inlayHints.parameterNames"] =... | 325 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/zed_settings.luau | luau | .luau | local StdPolyfills = require("../../../luau_packages/std_polyfills")
return function()
return StdPolyfills.serde.encode("json", {
lsp = {
["luau-lsp"] = {
settings = {
["luau-lsp"] = {
inlayHints = {
variableTypes = true,
functionReturnTypes = true,
parameterNames = "all",
... | 162 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/bin/zune_yml.luau | luau | .luau | return function(runtime: string): string?
if string.lower(runtime) ~= "zune" then
return nil
end
return [[globals:
zune:
any: true
]]
end
| 42 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/nvim.luau | luau | .luau | local pesde_future_patch = require("./bin/pesde_future_patch")
local pesde_sha256_patch = require("./bin/pesde_sha256_patch")
local license_md = require("./bin/license_md")
local init_src = require("./bin/init_src")
local env_file = require("./bin/env_file")
local luau_rc = require("./bin/luau_rc")
local pesde_toml = r... | 542 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/vscode.luau | luau | .luau | local pesde_future_patch = require("./bin/pesde_future_patch")
local pesde_sha256_patch = require("./bin/pesde_sha256_patch")
local vscode_settings = require("./bin/vscode_settings")
local license_md = require("./bin/license_md")
local init_src = require("./bin/init_src")
local env_file = require("./bin/env_file")
loca... | 587 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/create_app/src/projects/zed.luau | luau | .luau | local pesde_future_patch = require("./bin/pesde_future_patch")
local pesde_sha256_patch = require("./bin/pesde_sha256_patch")
local zed_settings = require("./bin/zed_settings")
local license_md = require("./bin/license_md")
local init_src = require("./bin/init_src")
local env_file = require("./bin/env_file")
local luau... | 584 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/dave/.zune/updateBinaries.luau | luau | .luau | -- TODO?
| 3 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/dave/src/buffer.luau | luau | .luau | --[=[
@class Dave.Buffer
Internal FFI interoperability helpers for the Dave package.
]=]
local stdPolyfills = require("../luau_packages/std_polyfills")
local Sys = require("./sys")
local ffi = stdPolyfills.ffi
--[=[
@within Dave.Buffer
]=]
local function toCString(value: string): FFIPointer
local length = #valu... | 1,439 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/dave/src/commitResult.luau | luau | .luau | --[=[
@class Dave.CommitResult
@__index Prototype
Holds the outcome of applying an MLS commit message via `Session:processCommit`.
A commit can succeed (the group epoch advanced), be ignored (the commit was redundant
or out-of-order), or fail hard (the commit was malformed). Always inspect `isFailed`
and `isIgn... | 826 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/dave/src/decryptor.luau | luau | .luau | --[=[
@class Dave.Decryptor
@__index Prototype
Decrypts incoming media frames using the DAVE protocol.
A Decryptor is created per remote participant stream. When the MLS group transitions
to a new epoch, call `transitionToKeyRatchet` with the ratchet derived for that
participant; the decryptor will maintain bot... | 1,550 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/dave/src/encryptor.luau | luau | .luau | --[=[
@class Dave.Encryptor
@__index Prototype
Encrypts outgoing media frames using the DAVE protocol.
An Encryptor operates on a single send stream. Once a `KeyRatchet` is set via
`setKeyRatchet`, each call to `encrypt` advances the ratchet and produces an
authenticated ciphertext. Before a ratchet is availabl... | 2,231 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/dave/src/init.luau | luau | .luau | --[=[
@class Dave
Entry point for the DAVE (Discord Audio/Video Encryption) end-to-end encryption protocol.
DAVE provides authenticated encryption for Discord voice channels using MLS
(Messaging Layer Security). The typical lifecycle for a client joining a voice channel is:
1. Create a `Session` and call `init`... | 942 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/dave/src/welcomeResult.luau | luau | .luau | --[=[
@class Dave.WelcomeResult
@__index Prototype
Holds the outcome of processing an MLS welcome message via `Session:processWelcome`.
A welcome message is sent by an existing group member when they commit a proposal to
add this client. Processing it transitions the session into the group and exposes the
initi... | 672 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/debugify/src/commands/capture.luau | luau | .luau | local CliBuilder = require("../../luau_packages/cli_builder")
local StdPolyfills = require("../../luau_packages/std_polyfills")
local diagnostics = require("../utilities/diagnostics")
local redact = require("../utilities/redact")
local command = CliBuilder.command
local ESC = "\x1b"
local LOG_MAX = 200
local LINE_WID... | 1,227 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/debugify/src/commands/info.luau | luau | .luau | local CliBuilder = require("../../luau_packages/cli_builder")
local StdPolyfills = require("../../luau_packages/std_polyfills")
local diagnostics = require("../utilities/diagnostics")
local command = CliBuilder.command
local color = not StdPolyfills.process.getEnv()["NO_COLOR"]
local BOLD = if color then "\x1b[1m" e... | 461 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/debugify/src/utilities/diagnostics.luau | luau | .luau | local StdPolyfills = require("../../luau_packages/std_polyfills")
local diagnostics = {}
local function resolveVersion(): string
local detectedRuntime = StdPolyfills.runtime.getRuntime()
if detectedRuntime == "Lute" then
local ok, result = pcall(StdPolyfills.process.run, "lute", { "--version" })
if ok and resu... | 295 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/debugify/src/utilities/redact.luau | luau | .luau | local sensitiveSubstrings: { string } = {
"token",
"secret",
"password",
"authorization",
"bearer",
"credential",
"api_key",
"apikey",
}
local function isSensitiveKeyword(keyword: string): boolean
local lowercaseKeyword = string.lower(keyword)
for _, substring in sensitiveSubstrings do
if string.find(lowe... | 936 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/discord_luau/src/init.luau | luau | .luau | local bot = require("@self/bot")
--[=[
@class DiscordLuau
Top level documentation for the Discord-Luau library, welcome! 👋
This package will represent the entrypoint to your adventure using Discord-Luau, through this package you'll generate
a discord Bot object, this bot Object enables you to write discord bots... | 160 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/example/src/init.luau | luau | .luau | local discordLuau = require("@self/../luau_packages/discord")
local discordBuilders = require("@self/../luau_packages/builders")
local opus = require("@self/../luau_packages/opus")
local env = require("@self/../../../.env")
local MAX_BARS = 60
local MIN_DBFS = -40
local discordBot = discordLuau.bot.new({
token = en... | 332 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/opus/src/buffer.luau | luau | .luau | --[=[
@class Opus.Buffer
@private
Internal FFI interoperability helpers for the Opus package.
Wraps `stdPolyfills.ffi` into named operations so higher-level modules never interact with it directly.
]=]
local stdPolyfills = require("../luau_packages/std_polyfills")
local ffi = stdPolyfills.ffi
local OpusBuffer =... | 434 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/opus/src/init.luau | luau | .luau | local Sys = require("@self/sys")
local Encoder = require("@self/encoder")
local Decoder = require("@self/decoder")
local Stats = require("@self/stats")
export type Encoder = Encoder.Encoder
export type Decoder = Decoder.Decoder
export type FrameStats = Stats.FrameStats
--[=[
@class Opus
FFI bindings for libopus, p... | 280 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/rest/src/init.luau | luau | .luau | local applicationRoleConnectionMetadata = require("@self/applicationRoleConnectionMetadata")
local invite = require("@self/invite")
local gateway = require("@self/gateway")
local emoji = require("@self/emoji")
local stageInstance = require("@self/stageInstance")
local application = require("@self/application")
local re... | 741 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/secret/src/init.luau | luau | .luau | --[=[
@class Secret
@__index Prototype
Implementation of a basic secret object in Luau, primarily used to store bot tokens so that
they can't be accidentally leaked into the console through a `print`
```luau
local a
a = secret.new("SOMETHING_SECRET")
print(a) --> "Secret(SOMETHIN--------)"
a = secret.new(1... | 637 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/snowflake/src/init.luau | luau | .luau | --[=[
@class Snowflake
@__index Prototype
Wrapper around Discord snowflakes, allowing developers to query information about a snowflake
]=]
local stdPolyfills = require("./luau_packages/std_polyfills")
local DISCORD_EPOCH = 1420070400000
local Snowflake = {}
Snowflake.Interface = {}
Snowflake.Prototype = {}
lo... | 692 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/sodium/src/aead/aes256gcm.luau | luau | .luau | --[=[
@class Sodium.Aes256gcm
AES-256-GCM authenticated encryption, detached tag variant.
Requires AES-NI hardware support - call isAvailable() before use; libsodium will abort on CPUs without it.
Uses a 12-byte nonce; always use a strict counter and rotate the key before reaching 2^32.
]=]
local Sys = require("... | 1,269 |
DiscordLuau/discord-luau | DiscordLuau-discord-luau-c74054b/packages/sodium/src/aead/chacha20poly1305.luau | luau | .luau | --[=[
@class Sodium.Chacha20poly1305
ChaCha20-Poly1305 (IETF, 12-byte nonce) authenticated encryption, detached tag variant.
Does not require AES-NI and works on all CPUs; for random nonces at scale use `xchacha20poly1305` instead.
Always use a strict counter nonce and rotate the key before reaching 2^32 messages... | 1,276 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.