{"id":34750950,"url":"https://github.com/commonly-ts/trivious","last_synced_at":"2026-04-30T11:01:44.705Z","repository":{"id":326826057,"uuid":"1102360947","full_name":"commonly-ts/trivious","owner":"commonly-ts","description":"Discord.js Framework","archived":false,"fork":false,"pushed_at":"2026-03-22T02:20:53.000Z","size":504,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T07:39:07.630Z","etag":null,"topics":["discord-js","framework"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/trivious","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commonly-ts.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-23T10:17:18.000Z","updated_at":"2026-03-22T02:20:55.000Z","dependencies_parsed_at":"2026-01-30T11:07:07.407Z","dependency_job_id":null,"html_url":"https://github.com/commonly-ts/trivious","commit_stats":null,"previous_names":["commonly-ts/trivious"],"tags_count":117,"template":false,"template_full_name":null,"purl":"pkg:github/commonly-ts/trivious","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonly-ts%2Ftrivious","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonly-ts%2Ftrivious/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonly-ts%2Ftrivious/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonly-ts%2Ftrivious/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commonly-ts","download_url":"https://codeload.github.com/commonly-ts/trivious/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonly-ts%2Ftrivious/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31393782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord-js","framework"],"created_at":"2025-12-25T05:01:10.941Z","updated_at":"2026-04-30T11:01:44.685Z","avatar_url":"https://github.com/commonly-ts.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trivious\n\nDiscord.js framework\n\n---\n\n### Installation\n\n```bash\nnpm install trivious\nyarn add trivious\npnpm add trivious\n```\n\n\u003e Requires Node.js 22+\n\n---\n\n### Quick Start\n\n```ts\n// src/index.ts\nimport { TriviousClient } from \"trivious\";\nimport { GatewayIntentBits } from \"discord.js\";\n\nconst client = new TriviousClient({\n\tcredentials: {\n\t\ttokenReference: \"BOT_TOKEN\",\n\t\tclientIdReference: \"CLIENT_ID\",\n\t},\n\tcorePath: \"core\", // Folder containing your bot's processes\n\tintents: [GatewayIntentBits.Guilds],\n\townerUserIds: [\"1234\"],\n});\n\n(async () =\u003e {\n\ttry {\n\t\tawait client.start();\n\t\t// Registers all commands, events, components, modules;\n\t\t// Deploys slash commands globally and then logs into the bot\n\n\t\t// To separately deploy commands - use client.deploy() followed by client.login()\n\t} catch (err: unknown) {\n\t\tconst error = err as Error;\n\t\tconsole.error(\"Failed to start bot:\", error);\n\t}\n})();\n```\n\n---\n\n### Included Default Events\n\nTrivious automatically includes and inserts `clientReady` and `interactionCreate` handlers, which can be overwritten.\nIt is recommended to use the default interactionCreate handler, which requires zero setup in your own code.\n\nThese default events can be found in `src/features/events/presets` in the Trivious repository.\n\n---\n\n### Code examples\nExamples for commands, components, events and modules can be found at https://github.com/commonly-ts/discord-bot-template/tree/main/templates.\n\n---\n\n### Creating a Slash Command\n\n```ts\n// commands/debug/index.ts\nimport { ApplicationCommandType, SlashCommandBuilder } from \"discord.js\";\nimport { SlashCommandData } from \"trivious\";\n\nexport default {\n\tactive: true,\n\tcontext: \"SlashCommand\",\n\tcommandType: ApplicationCommandType.ChatInput,\n\tflags: [\"Cached\", \"EphemeralReply\", \"DeferReply\"],\n\tdata: new SlashCommandBuilder().setName(\"debug\").setDescription(\"Debug commands\"),\n} satisfies SlashCommandData;\n```\n\n### Creating a Subcommand Group\n\n```ts\n// commands/debug/config/index.ts\nimport { Collection, SlashCommandSubcommandGroupBuilder } from \"discord.js\";\nimport { SlashSubcommandGroupData } from \"trivious\";\n\nexport default {\n\tcontext: \"SlashSubcommandGroup\",\n\tdata: new SlashCommandSubcommandGroupBuilder()\n\t\t.setName(\"config\")\n\t\t.setDescription(\"Config commands\"),\n\tsubcommands: new Collection(),\n} satisfies SlashSubcommandGroupData;\n```\n\n\u003e Subcommands go in the same directory as the subcommand group file and are auto-detected.\n\n---\n\n### Creating a Subcommand\n\n```ts\n// commands/debug/ping.ts\nimport { ApplicationCommandType, SlashCommandSubcommandBuilder } from \"discord.js\";\nimport { interactionReply, SlashSubcommandData } from \"trivious\";\n\nexport default {\n\tactive: true,\n\tcontext: \"SlashSubcommand\",\n\tcommandType: ApplicationCommandType.ChatInput,\n\tdata: new SlashCommandSubcommandBuilder().setName(\"ping\").setDescription(\"Ping pong!\"),\n\n\tasync execute(client, interaction) {\n\t\tconst ping = (await interaction.fetchReply()).createdTimestamp - interaction.createdTimestamp;\n\n\t\tawait interactionReply({\n\t\t\tinteraction,\n\t\t\treplyPayload: {\n\t\t\t\tcontent: `Pong!\\nBot latency: ${ping}ms, API latency: ${client.ws.ping.toString()}ms`,\n\t\t\t},\n\t\t\tflags: [\"EphemeralReply\"],\n\t\t});\n\t},\n} satisfies SlashSubcommandData;\n```\n\n---\n\n### Project Structure\n\nAny project structure (e.g. type-based, feature-based) is acceptable as long as everything you expect to be registered are within the core directory.\n\nFor example, if all of your commands, components, events and modules are anywhere inside src/features, assuming they export the correct data, they will be detected and registered to the client.\n\nThe only required specific structure are for slash commands, as shown below.\n\n```\ncommand/\n├── index.ts\n├── subcommand.ts\n└── subcommand-group/\n\t\t├── index.ts\n \t\t└──subcommand.ts\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonly-ts%2Ftrivious","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommonly-ts%2Ftrivious","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonly-ts%2Ftrivious/lists"}