{"id":25306540,"url":"https://github.com/epoktarren/mashu","last_synced_at":"2026-04-11T00:09:53.142Z","repository":{"id":42482630,"uuid":"356666232","full_name":"EpokTarren/mashu","owner":"EpokTarren","description":"A small typescript command handler for discord bots. Written for mainly for use within Astolto.","archived":false,"fork":false,"pushed_at":"2023-09-19T15:42:01.000Z","size":353,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-09-19T18:09:11.161Z","etag":null,"topics":["bot","discord","discord-api","discord-bot","discord-js","discordjs","javascript","javascript-library","nodejs","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"https://mashu.tarren.moe/","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/EpokTarren.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}},"created_at":"2021-04-10T18:41:37.000Z","updated_at":"2023-09-19T18:09:11.256Z","dependencies_parsed_at":"2024-09-17T23:07:07.165Z","dependency_job_id":null,"html_url":"https://github.com/EpokTarren/mashu","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":0.09756097560975607,"last_synced_commit":"c1d67e5ab46e22d9382d3fdcbab3e7f5ea5813e1"},"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpokTarren%2Fmashu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpokTarren%2Fmashu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpokTarren%2Fmashu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EpokTarren%2Fmashu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EpokTarren","download_url":"https://codeload.github.com/EpokTarren/mashu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601445,"owners_count":20964865,"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","discord","discord-api","discord-bot","discord-js","discordjs","javascript","javascript-library","nodejs","typescript","typescript-library"],"created_at":"2025-02-13T10:26:01.189Z","updated_at":"2025-12-30T23:06:44.539Z","avatar_url":"https://github.com/EpokTarren.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MashuJS\r\n\r\nMashuJS is a command handler for [discord.js](https://discord.js.org/#/) written in TypeScript for [astolto](https://github.com/EpokTarren/astolto).\r\n\r\n# Getting started\r\n\r\nThe client provided is an extension of discord.js [client](https://discord.js.org/#/docs/main/stable/class/Client) that has a handler attached. You can also view the [documentation page](https://mashu.tarren.moe/) for more extensive docs.\r\n\r\n```sh\r\n# with npm\r\nnpm install mashujs discord.js\r\n# with yarn\r\nyarn add mashujs discord.js\r\n```\r\n\r\nInitialise a client and pass it to a handler\r\n\r\n```js\r\nconst { Client } = require('mashujs');\r\nconst { resolve } = require('path');\r\n\r\nconst client = new Client({\r\n\tdisableMentions: 'everyone',\r\n\tdir: resolve(__dirname, 'commands'),\r\n\towners: ['your id'],\r\n\tprefix: 'a;',\r\n\tenableHelp: true,\r\n\terrorChannel: 'Some channel id',\r\n});\r\n\r\nclient.once('ready', () =\u003e {\r\n\tclient.handler.loadSlashCommands();\r\n});\r\n\r\nclient.login('your bot token');\r\n```\r\n\r\nSimple example command\r\n\r\n```ts\r\nconst max = 1 \u003c\u003c 32;\r\nexport = new Command({\r\n\tasync run(message) {\r\n\t\tlet n = message.options.getInteger('n') || 6;\r\n\r\n\t\tif (n \u003e max) n = max;\r\n\t\telse if (n \u003c 2) n = 6;\r\n\r\n\t\tconst roll = Math.floor(Math.random() * n) + 1;\r\n\r\n\t\tmessage.reply(`You rolled ${roll}`);\r\n\t},\r\n\tname: 'Roll',\r\n\taliases: ['R', 'Dice', 'D'],\r\n\tdescription: 'Roll an n-sided die.',\r\n\tdetailed: 'Roll a number between 1 and n.',\r\n\texamples: [(prefix) =\u003e `${prefix}roll`, (prefix) =\u003e `${prefix}r 1000`, (prefix) =\u003e `${prefix}d 1000000`],\r\n\targuments: [\r\n\t\t{\r\n\t\t\ttype: 'Integer',\r\n\t\t\tname: 'n',\r\n\t\t\tdescription: 'Max roll value.',\r\n\t\t\trequired: false,\r\n\t\t},\r\n\t],\r\n\tparseArgs: true,\r\n\tinteraction: 'on',\r\n});\r\n```\r\n\r\nYou can set some environment variables to change the styling of output\r\n\r\n```ts\r\nprocess.env.HELPFOOTER; // Footer text for help command\r\nprocess.env.HELPFOOTERICON; // Footer icon for help command\r\nprocess.env.MASHUCOLOR; // Default color for built in commands default \"0xff80cc\"\r\nprocess.env.MASHUERRORCOLOR; // Error color for built in error logging default \"0xff8080\"\r\nprocess.env.MASHUDEBUGGUILD; // Guild to limit testing of slash command pushes to, default is undefined\r\n```\r\n\r\n# Docs generation\r\n\r\nDefault `.mashurc.json` config can be generated by running\r\n\r\n```sh\r\nnpx mashujs --new\r\n```\r\n\r\nAfter that edit your config.\r\n\r\n## Properties\r\n\r\n- `prefix`, Prefix to use when generating examples.\r\n- `input`, Path to command locations.\r\n- `output`, Path to docs folder.\r\n- `readme`, Path to the readme.md for the bot as a whole and will export as index.md.\r\n- `descriptions`, Will include a description beneath the title if one exists in the command categories folder as README.md.\r\n- `descriptionReplacer`, Replace build path with src path to locate README files, [\"build\", \"src\"]\r\n- `titles`, Whether or not to include jekyll titles.\r\n- `permalink`, Whether or not to include jekyll permalinks.\r\n- `layout`, Jekyll layout for command pages.\r\n- `homeHeader`, Jekyll header options for index.md such as; \"layout: home\".\r\n\r\n# License\r\n\r\nMashuJS is licensed under [MIT](./LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepoktarren%2Fmashu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepoktarren%2Fmashu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepoktarren%2Fmashu/lists"}