{"id":18765516,"url":"https://github.com/sawa-ko/revoltx","last_synced_at":"2025-07-07T00:06:50.480Z","repository":{"id":37048927,"uuid":"465913643","full_name":"sawa-ko/revoltx","owner":"sawa-ko","description":"Revoltx is a Framework for revolt.js to create awesome bots.","archived":false,"fork":false,"pushed_at":"2025-07-01T20:44:43.000Z","size":11611,"stargazers_count":12,"open_issues_count":11,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-06T15:16:07.523Z","etag":null,"topics":["bot","framework","revolt","revolt-bot"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sawa-ko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-03T23:10:07.000Z","updated_at":"2025-06-03T12:28:09.000Z","dependencies_parsed_at":"2023-12-21T19:16:10.017Z","dependency_job_id":"2c6a0c7b-d4e0-49a6-beac-782f76031f27","html_url":"https://github.com/sawa-ko/revoltx","commit_stats":{"total_commits":312,"total_committers":6,"mean_commits":52.0,"dds":0.5897435897435898,"last_synced_commit":"7ed312184d83f652ec0d5b2a17af8b69cec6f74f"},"previous_names":["kaname-png/revoltx"],"tags_count":39,"template":false,"template_full_name":"sapphiredev/sapphire-template","purl":"pkg:github/sawa-ko/revoltx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawa-ko%2Frevoltx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawa-ko%2Frevoltx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawa-ko%2Frevoltx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawa-ko%2Frevoltx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sawa-ko","download_url":"https://codeload.github.com/sawa-ko/revoltx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sawa-ko%2Frevoltx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263991446,"owners_count":23540665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bot","framework","revolt","revolt-bot"],"created_at":"2024-11-07T18:34:23.702Z","updated_at":"2025-07-07T00:06:50.461Z","avatar_url":"https://github.com/sawa-ko.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![RevoltX Logo](https://raw.githubusercontent.com/kaname-png/revoltx/development/.github/assets/logo-transparent.png)\n\n# @kaname-png/revoltx\n\n**Create Revolt bots in a simple, fast and fun way**\n\n[![GitHub](https://img.shields.io/github/license/kaname-png/revoltx)](https://github.com/kaname-png/revoltx/blob/main/LICENSE.md)\n[![codecov](https://codecov.io/gh/kaname-png/revoltx/branch/main/graph/badge.svg?token=0MSAyoZNxz)](https://codecov.io/gh/kaname-png/revoltx)\n[![npm](https://img.shields.io/npm/v/@kaname-png/revoltx?color=crimson\u0026logo=npm\u0026style=flat-square)](https://www.npmjs.com/package/@kaname-png/revoltx)\n[![npm](https://img.shields.io/npm/dt/@kaname-png/revoltx?color=crimson\u0026logo=npm)](https://www.npmjs.com/package/@kaname-png/revoltx)\n\n\u003c/div\u003e\n\n## Features\n\n-   Full ESM\n-   TypeScript \u0026 JavaScript support\n-   Written in TypeScript\n-   Completely Modular and Extendable\n-   Command Handler, Arguments, Preconditions and Listeners Store\n-   Powered by [@sapphire/framework](https://github.com/sapphiredev/framework) preconditions and arguments system\n\n# 🔎 Introduction\n\nWith RevoltX you have at your disposal the creation of highly typed, secure and easy to make bots with a wide variety of tools and utilities available.\n\n# ❗ Usage\n\nNow you can continue installing the necessary packages.\n\n```\nnpm i @kaname-png/revoltx revolt.js\n```\n\nOr\n\n```\nyarn add @kaname-png/revoltx revolt.js\n```\n\n### 🤖 Client\n\nThis is how the client is created and the bot is started.\n\n```typescript\n// client.js\nimport { Client } from '@kaname-png/revoltx';\nimport { join } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst start = () =\u003e {\n\tconst client = new Client({ prefix: '!' });\n\tawait client.login('\u003cBOT_TOKEN\u003e');\n};\n\nvoid start();\n```\n\nNow you can start bot as follows:\n\n```\nnode --experimental-specifier-resolution=node client.js\n```\n\nTo set the path to the commands, listeners, etc. you need to indicate the path to your \"main.js\" file (the file which starts your bot) in the \"main\" property of your `package.json` file.\n\n\u003e Remember that the name of your main file `(main.js)` is up to you.\n\nFor JavaScript it should be for example:\n\n```json\n{\n\t\"name\": \"my-awesome-bot\",\n\t\"version\": \"1.0.0\",\n\t\"main\": \"src/main.js\"\n}\n```\n\nFor TypeScript it should be for example:\n\n```json\n{\n\t\"name\": \"my-awesome-bot\",\n\t\"version\": \"1.0.0\",\n\t\"main\": \"dist/main.js\"\n}\n```\n\n### 📁 Folder Structure\n\nOnce the client is created and instantiated, it is time to configure where all your commands, listeners, arguments, etc. are located.\n\n```typescript\nimport { Client } from '@kaname-png/revoltx';\nimport { join } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst start = () =\u003e {\n\tconst client = new Client({ prefix: '!' });\n\tawait client.login('\u003cBOT_TOKEN\u003e');\n};\n```\n\nOur project should have a folder structure like this.\n\n```\n├───commands\n│   └───help.js\n└───main.js\n```\n\n# 📝 Create command\n\nBasic structure of a basic command.\n\nCommands are actions that users can request to the bot by means of a prefix and command name, e.g.: `n!help`.\n\n```typescript\n// commands/help.ts\nimport { Command, CommandOptions, PieceContext } from '@kaname-png/revoltx';\nimport type { Message } from 'revolt.js';\n\nexport class HelpCommand extends Command {\n\t// If you need to add extra options to the command, you can do it in the constructor, it is not required if you don't need to add options.\n\tconstructor(context: PieceContext, options: CommandOptions) {\n\t\tsuper(context, {\n\t\t\t...options,\n\t\t\talias: ['helpme']\n\t\t\t/* optional commands options */\n\t\t});\n\t}\n\n\tpublic async run(message: Message) {\n\t\treturn message.reply('@kaname-png/revoltx');\n\t}\n}\n```\n\n# 🔉 Create listener\n\nBasic structure of a basic listener.\n\nThe listeners have the function of listening to events that the client emits by default, but you can assign the emitter you need and listen to the events of that emitter.\n\n```typescript\n// listener/message.ts\nimport { Listener, ListenerOptions ClientEvents, PieceContext } from '@kaname-png/revoltx';\nimport type { Message } from 'revolt.js';\n\nexport class MessageListener extends Listener {\n\t// You can set the event name you need.\n\tconstructor(context: PieceContext, options: ListenerOptions) {\n\t\tsuper(context, {\n                  ...options,\n                  event: ClientEvents.MessageCreate\n                  /* optional listeners options */\n                });\n\t}\n\n\tpublic async run(message: Message) {\n\t\treturn message.reply('@kaname-png/revoltx');\n\t}\n}\n```\n\n# 🛡️ Create Argument\n\nBasic structure of a basic argument.\nArguments are parameters that the bot receives from the message sent by the user. This argument system allows to use arguments dynamically as needed, and not only by configuring the command options.\n\n```typescript\n// arguments/serverOwner.ts\nimport { Argument, ArgumentOptions ArgumentResult, PieceContext } from '../lib/structures/argument';\nimport type { ArgumentContext } from '../utils/interfaces/argument';\n\n// \u003cboolean\u003e is for TypeScript users only.\nexport class ServerOwnerArgument extends Argument\u003cboolean\u003e {\n\t// Asign name of argument\n\tpublic constructor(context: PieceContext, options: ArgumentOptions) {\n\t\tsuper(context, {\n                  ...options,\n                  name: 'ServerOwner'\n                  /* optional arguments options */\n                });\n\t}\n\n\tpublic run(parameter: string, context: ArgumentContext): ArgumentResult\u003cboolean\u003e {\n\t\tconst resolved = message.member?.server?.owner === parameter;\n\t\tif (!resolved) return this.ok(true);\n\n\t\treturn this.error({\n\t\t\tparameter,\n\t\t\tidentifier: resolved.error,\n\t\t\tmessage: 'The argument did not resolve to server owner.',\n\t\t\tcontext\n\t\t});\n\t}\n}\n\n// For TypeScript users only.\ndeclare module '@kaname-png/revoltx' {\n\tinterface ArgType {\n\t\t// The type returned by the this.ok() method;\n\t\tServerOwner: boolean;\n\t}\n}\n\n// Command Usage\n// User Input: n!server @kaname-png\nimport { Args, Command } from '@kaname-png/revoltx';\nimport type { Message } from 'revolt.js';\n\nexport class ServerCommand extends Command {\n\tpublic run(message: Message, args: Args) {\n\t\tconst owner = await args.pick('ServerOwner');\n\t\treturn message.channel?.sendMessage(owner ? 'You are server owner.' : 'You are not the owner of the server.');\n\t}\n}\n```\n\n# 🛡️ Create Precondition\n\nBasic structure of a basic precondition.\n\n```typescript\n// preconditions/nsfw.ts\nimport type { PieceContext, Precondition, PreconditionOptions, PreconditionResult, Identifiers } from '@kaname-png/revoltx';\nimport type { Message } from 'revolt.js';\n\nexport class NSFWPrecondition extends Precondition {\n\tpublic constructor(context: PieceContext, options: PreconditionOptions) {\n\t\tsuper(context, {\n\t\t\t...options,\n\t\t\tname: 'NSFW'\n\t\t\t/* optional preconditions options */\n\t\t});\n\t}\n\n\tpublic run(message: Message): PreconditionResult {\n\t\treturn message.channel?.nsfw === true\n\t\t\t? this.ok()\n\t\t\t: this.error({ identifier: Identifiers.PreconditionsNsfw, message: 'You cannot run this command outside NSFW channels.' });\n\t}\n}\n\n// For TypeScript users only.\ndeclare module '@kaname-png/revoltx' {\n\tinterface Preconditions {\n\t\t// Name of precondition\n\t\tNSFW: never;\n\t}\n}\n```\n\n# 📚 Notes\n\n1. More examples in the comments of the corresponding classes.\n2. The examples shown are written in TypeScript, but you can replicate them in JavaScript by simply removing the variable types.\n\n#### Example of converting TypeScript code to JavaScript code:\n\n\u003e This also applies to arguments, listeners, preconditions, etc.\n\nTypeScript code\n\n```typescript\n// commands/help.ts\nimport { Command, CommandOptions, PieceContext } from '@kaname-png/revoltx';\nimport type { Message } from 'revolt.js';\n\nexport class HelpCommand extends Command {\n\t// If you need to add extra options to the command, you can do it in the constructor, it is not required if you don't need to add options.\n\tconstructor(context: PieceContext, options: CommandOptions) {\n\t\tsuper(context, {\n\t\t\t...options\n\t\t\t/* optional commands options */\n\t\t});\n\t}\n\n\tpublic run(message: Message) {\n\t\treturn message.reply('@kaname-png/revoltx');\n\t}\n}\n```\n\nJavaScript code\n\n```javascript\n// commands/help.js\nimport { Command } from '@kaname-png/revoltx';\n\nexport class HelpCommand extends Command {\n\t// If you need to add extra options to the command, you can do it in the constructor, it is not required if you don't need to add options.\n\tconstructor(context, options) {\n\t\tsuper(context, {\n\t\t\t...options\n\t\t\t/* optional commands options */\n\t\t});\n\t}\n\n\trun(message) {\n\t\treturn message.reply('@kaname-png/revoltx');\n\t}\n}\n```\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://kaname.netlify.app\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/56084970?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKaname\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/kaname-png/revoltx/issues?q=author%3Akaname-png\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e \u003ca href=\"https://github.com/kaname-png/revoltx/commits?author=kaname-png\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/kaname-png/revoltx/commits?author=kaname-png\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#ideas-kaname-png\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#maintenance-kaname-png\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"#projectManagement-kaname-png\" title=\"Project Management\"\u003e📆\u003c/a\u003e \u003ca href=\"https://github.com/kaname-png/revoltx/pulls?q=is%3Apr+reviewed-by%3Akaname-png\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawa-ko%2Frevoltx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsawa-ko%2Frevoltx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsawa-ko%2Frevoltx/lists"}