{"id":18960271,"url":"https://github.com/joaquimnet/discordjs-prompter","last_synced_at":"2025-06-23T11:37:02.569Z","repository":{"id":40940577,"uuid":"170796722","full_name":"joaquimnet/discordjs-prompter","owner":"joaquimnet","description":"Prompt for a user response using reactions or a message.","archived":false,"fork":false,"pushed_at":"2023-01-05T16:18:33.000Z","size":1055,"stargazers_count":13,"open_issues_count":18,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T10:46:42.989Z","etag":null,"topics":["library"],"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/joaquimnet.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}},"created_at":"2019-02-15T03:33:10.000Z","updated_at":"2024-04-29T14:03:53.000Z","dependencies_parsed_at":"2023-02-04T06:45:27.160Z","dependency_job_id":null,"html_url":"https://github.com/joaquimnet/discordjs-prompter","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/joaquimnet/discordjs-prompter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaquimnet%2Fdiscordjs-prompter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaquimnet%2Fdiscordjs-prompter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaquimnet%2Fdiscordjs-prompter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaquimnet%2Fdiscordjs-prompter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaquimnet","download_url":"https://codeload.github.com/joaquimnet/discordjs-prompter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaquimnet%2Fdiscordjs-prompter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261044451,"owners_count":23101836,"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":["library"],"created_at":"2024-11-08T14:05:05.790Z","updated_at":"2025-06-23T11:36:57.554Z","avatar_url":"https://github.com/joaquimnet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1  align=\"center\"\u003ediscordjs-prompt 👋\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://npmjs.com/package/discordjs-prompter\"\u003e\n\u003cimg  src=\"https://img.shields.io/npm/v/discordjs-prompter.svg\"  /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/joaquimnet/discordjs-prompter#readme\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/package-json/v/joaquimnet/discordjs-prompter/master.svg?color=yellow\" alt=\"Version@Master\" /\u003e\n\u003c/a\u003e\n\u003ca  href=\"https://joaquimnet.github.io/discordjs-prompter\"\u003e\n\u003cimg  alt=\"Documentation\"  src=\"https://img.shields.io/badge/documentation-yes-green.svg\"  target=\"_blank\"  /\u003e\n\u003c/a\u003e\n\u003ca  href=\"https://github.com/joaquimnet/discordjs-prompter/blob/master/LICENSE\"\u003e\n\u003cimg  alt=\"License: MIT\"  src=\"https://img.shields.io/badge/License-MIT-green.svg\"  target=\"_blank\"  /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\nPrompt for a user response using reactions or a message.\n\n## Features\n- Message prompt -\u003e Get text\n- Reaction prompt -\u003e Accept or cancel\n- Vote prompt **(new)** -\u003e Collect votes\n- Choice prompt **(new)** -\u003e An emoji reaction\n\n## Examples\n\nMessage Prompt:\n\n```javascript\nconst prompter = require('discordjs-prompter');\n\nclient.on('message', msg =\u003e {\n  // Listen for a message starting with !foo\n\n  if (msg.content.startsWith('!foo')) {\n    // Prompts the user if wether they like bacon or not\n\n    prompter\n      .message(msg.channel, {\n        question: 'Do you like bacon?',\n        userId: msg.author.id,\n        max: 1,\n        timeout: 10000,\n      })\n      .then(responses =\u003e {\n        // If no responses, the time ran out\n        if (!responses.size) {\n          return msg.channel.send(`No time for questions? I see.`);\n        }\n        // Gets the first message in the collection\n        const response = responses.first();\n\n        // Respond\n        msg.channel.send(`**${response}** Is that so?`);\n      });\n  }\n});\n```\n\n![alt text](https://i.imgur.com/nNfBXYi.gif \"Answering to the bot's question.\")\n\n* * *\n\nReaction Prompt:\n\n```javascript\nconst prompter = require('discordjs-prompter');\n\nclient.on('message', msg =\u003e {\n  // Listen for a message starting with !bar\n  if (msg.content.startsWith('!bar')) {\n    // Asks if user is sure\n    prompter\n      .reaction(msg.channel, {\n        question: 'Are you sure?',\n        userId: msg.author.id,\n      })\n      .then(response =\u003e {\n        // Response is false if time runs out\n        if (!response) return msg.reply('you took too long!');\n        // Returns 'yes' if user confirms and 'no' if ser cancels.\n        if (response === 'yes') return msg.channel.send('You chose yes!');\n        if (response === 'no') return msg.channel.send('You chose no!');\n      });\n  }\n});\n```\n\n![alt text](https://i.imgur.com/Uhko2lY.gif \"Reacting to the bot's message\")\n\n* * *\n\nVote prompt:\n\n```javascript\n  // ...other discordjs logic\n  Prompter.vote(message.channel, {\n    question: 'Cast your vote!',\n    choices: ['🔥', '💙'],\n    timeout: 3000,\n  }).then((response) =\u003e {\n    const winner = response.emojis[0];\n    message.channel.send(winner.emoji + ' won!!');\n  });\n  // other discordjs logic...\n```\n\n![alt text](https://i.imgur.com/jdNkRhi.gif \"Voting on the message\")\n\n* * *\n\nChoice prompt:\n\n```javascript\n  // ...other discordjs logic\n  const response = await Prompter.choice(message.channel, {\n    question: 'Pick an emoji!',\n    choices: ['✨', '❌'],\n    userId: message.author.id\n  });\n  console.log(response); // -\u003e ✨ or ❌ or null if user doesn't respond\n  // other discordjs logic...\n```\n\n* * *\n\n## Documentation\n\n[Go to documentation](https://joaquimnet.github.io/discordjs-prompter)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaquimnet%2Fdiscordjs-prompter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaquimnet%2Fdiscordjs-prompter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaquimnet%2Fdiscordjs-prompter/lists"}