{"id":23571671,"url":"https://github.com/r-zubkov/discord-bot-constructor","last_synced_at":"2026-04-09T08:58:21.268Z","repository":{"id":54532532,"uuid":"324648025","full_name":"r-zubkov/discord-bot-constructor","owner":"r-zubkov","description":"Simple bot constructor for discord, based on Discord.js","archived":false,"fork":false,"pushed_at":"2021-02-12T14:53:25.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T04:40:34.781Z","etag":null,"topics":["bot","discord","discord-bot","discord-js","typescript"],"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/r-zubkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-26T22:51:04.000Z","updated_at":"2021-02-12T14:46:00.000Z","dependencies_parsed_at":"2022-08-13T18:50:55.028Z","dependency_job_id":null,"html_url":"https://github.com/r-zubkov/discord-bot-constructor","commit_stats":null,"previous_names":["insane-ray/discord-bot-constructor"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/r-zubkov/discord-bot-constructor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-zubkov%2Fdiscord-bot-constructor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-zubkov%2Fdiscord-bot-constructor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-zubkov%2Fdiscord-bot-constructor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-zubkov%2Fdiscord-bot-constructor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r-zubkov","download_url":"https://codeload.github.com/r-zubkov/discord-bot-constructor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r-zubkov%2Fdiscord-bot-constructor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272698274,"owners_count":24978423,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bot","discord","discord-bot","discord-js","typescript"],"created_at":"2024-12-26T20:19:05.242Z","updated_at":"2026-04-09T08:58:16.246Z","avatar_url":"https://github.com/r-zubkov.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple bot constructor for [Discord](https://discord.com/)\n## Overview\nSimple bot constructor for discord, \nbased on [Discord.js](https://discord.js.org/), \nand written with [TypeScript](https://www.typescriptlang.org/).\n\u003cbr\u003e\n\u003cbr\u003e\n**Important!** if you want to use **randomMember** slug, you need to turn on option **SERVER MEMBERS INTENT** in your application bot settings.\n###### Links:\n- [Example](https://github.com/insane-ray/discord-bot-example)\n- [Visual Editor](https://github.com/insane-ray/discord-bot-ve)\n\n## Requirements\n[Node.js](https://nodejs.org/) 12 or newer.\n\n## Installation\nFor installation type `npm i discord-bot-constructor`\n\n## Documentation\nSee example [here](https://github.com/insane-ray/discord-bot-example).\n\n### 1. Init \nOptions:\n- `token` - your bot token\n- `prefix` - sign to start your command like `/` or `$`\n- `config` - see [config](https://github.com/insane-ray/discord-bot-constructor/#2-config) section\n\nExample:\n```js\nconst { BotConstructor } = require(\"discord-bot-constructor\");\n\nconst botConstructor = new BotConstructor({\n  token: string,\n  prefix: string,\n  config: BotConfig\n});\n```\n\n### 2. Config\nOptions:\n- `actions` - list of actions\n- `botState` - set bot presence state (optional)\n- `i18n` - internalization (optional)\n\nSee example [here](https://github.com/insane-ray/discord-bot-example/blob/main/actions.json).\n\nInterface:\n```js\nBotConfig {\n  actions: BotAction[];\n  botState?: BotState;\n  i18n?: IterableData\u003cstring\u003e;\n}\n```\n#### 2.1 Config `actions`\nList of bot actions\n\u003cbr\u003e\u003cbr\u003e\nOptions: \n- `name` - action name\n- `type` - list of available action types:\n    * `simple` simple action without any params such as **/rand**\n    * `mention` action that mention user **/mention @User**\n    * `text` action with text parameter **/bot random joke**\n    * `nested` for `text` type of action, using for nested text options\n- `helpInfo` - needed for `/help` action (optional)\n- `children` - combines with `text` action type, contains nested actions (optional)\n- `phrases` - list of text responses (can contain link) (optional), randomly take one from list. \n\u003cbr\u003e You can also use slugs in text:\n    * `{author}` - insert message author\n    * `{mentionedUser}` - insert mentioned user in action (works only witn `mention` action type)\n    * `{randomNumber}` - insert random number between 1 and 100\n    * `{randomMember}` - insert random guild member (if you want to use this one, you need to turn on option `SERVER MEMBERS INTENT` in your application bot settings)\n\n`Simple` action example:\n```js\n{\n  name: \"joke\",\n  type: \"simple\",\n  helpInfo: \"example of usage: '/joke'\",\n  phrases: [\n    \"{author}, may be you tell us one?\",\n    \"Random decided, it's time {randomMember} to telling joke\",\n    \"Most people are shocked when they find out how bad I am as an electrician\"\n  ]\n}\n```\n\n`Mention` action example:\n```js\n{\n  name: \"ping\",\n  type: \"mention\",\n  helpInfo: \"example of usage: '/ping @User'\",\n  phrases: [\n    \"{author} pinging {mentionedUser}\",\n    \"{mentionedUser} is not answering\"\n  ]\n}\n```\n\n`Text` action example:\n```js\n{\n  name: \"random\",\n  type: \"text\",\n  helpInfo: \"example of usage: '/random command' (number, member)\",\n  children: [\n    {\n      name: \"number\",\n      type: \"nested\",\n      phrases: [\n        \"Random number is {randomNumber}\"\n      ]\n    },\n    {\n      name: \"member\",\n      type: \"nested\",\n      phrases: [\n        \"Random member is {randomMember}\"\n      ]\n    },\n    {\n      name: \"image\",\n      type: \"nested\",\n      phrases: [\n        \"https://cdn.spacetelescope.org/archives/images/wallpaper2/heic1509a.jpg\",\n        \"https://cdn.spacetelescope.org/archives/images/wallpaper2/heic1501a.jpg\",\n        \"https://cdn.spacetelescope.org/archives/images/wallpaper2/heic0506a.jpg\",\n      ]\n    }\n  ]\n}\n```\n\nInterface:\n```js\nBotAction {\n  name: string;\n  type: 'simple' | 'mention' | 'text' | 'nested';\n  helpInfo?: string;\n  children?: BotAction[];\n  phrases?: string[];\n}\n```\n#### 2.2 Config `botState` (optional)\nSetting bot status and presence.\n\nOptions:\n- `activity` - available options:\n    * `name` - activity name\n    * `type` - activity type:\n        * `PLAYING`\n        * `STREAMING`\n        * `LISTENING`\n        * `WATCHING`\n    * `url` - url link (optional)\n- `status` - available bot statuses:\n    * `online`\n    * `idle`\n    * `dnd`\n\nExample:\n```js\n{\n  activity: {\n    name: \"testing bot\",\n    type: \"PLAYING\"\n  },\n  status: \"online\"\n}\n```\n\nInterface:\n```js\nBotState {\n  activity: {\n    name: string;\n    type: 'PLAYING' | 'STREAMING' | 'LISTENING' | 'WATCHING';\n    url?: string;\n  }\n  status: 'online' | 'idle' | 'dnd'\n}\n```\n\n#### 2.3 Config `i18n` (optional)\nTranslate default system messages.\n\nOptions:\n- `actionNotFound` - action not found\n- `argumentNotFound` - action not found\n- `wrongMention` - No user mentioned\n- `wrongArgument` - Invalid argument\n- `helpInfoList` - '/help list' - to see all actions\n- `helpInfoAction` - '/help action' - to get help about specific action\n- `helpList` - List of available actions:\n\nExample:\n```js\n{\n  actionNotFound: \"action not found\",\n  argumentNotFound: \"action not found\",\n  wrongMention: \"No user mentioned\",\n  wrongArgument: \"Invalid argument\",\n  helpInfoList: \"'/help list' - to see all actions\",\n  helpInfoAction: \"'/help action' - to get help about specific action\",\n  helpList: \"List of available actions:\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-zubkov%2Fdiscord-bot-constructor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr-zubkov%2Fdiscord-bot-constructor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr-zubkov%2Fdiscord-bot-constructor/lists"}