{"id":22166212,"url":"https://github.com/maxerbox/message-suite-fisherman","last_synced_at":"2025-03-24T16:15:30.056Z","repository":{"id":57295207,"uuid":"104558597","full_name":"maxerbox/message-suite-fisherman","owner":"maxerbox","description":"A middleware used to add some features to fisherman, like bot typing, or Embed compatibility","archived":false,"fork":false,"pushed_at":"2017-09-23T18:16:31.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T07:54:12.771Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxerbox.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":"2017-09-23T10:08:13.000Z","updated_at":"2017-09-23T18:10:08.000Z","dependencies_parsed_at":"2022-08-30T22:30:32.728Z","dependency_job_id":null,"html_url":"https://github.com/maxerbox/message-suite-fisherman","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxerbox%2Fmessage-suite-fisherman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxerbox%2Fmessage-suite-fisherman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxerbox%2Fmessage-suite-fisherman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxerbox%2Fmessage-suite-fisherman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxerbox","download_url":"https://codeload.github.com/maxerbox/message-suite-fisherman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245304868,"owners_count":20593626,"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":[],"created_at":"2024-12-02T05:18:30.915Z","updated_at":"2025-03-24T16:15:30.021Z","avatar_url":"https://github.com/maxerbox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message Suite - Fisherman\n\n\u003e Add some message features to fisherman. Copyrights (c), Simon Sassi 2017\n\n## What is the message suite\n\nThe message suite is a fisherman middleware that is using the prototype editing available by fisherman\nIt edits the FisherResponse prototype to provide some cool features like:\n\n- Bot Typing: send a message with a delay to simulate real user typing, with `response.send()`\n- Embed compatibility: it checks if the bot can send embed, if it can't, it convert the embed to a formatted text\n\n## Setting up\n\n```bash\nnpm install --save command-loader-fisherman\n```\n\nInclude the middleware to the bot:\n\n```javascript\n[...]\nconst MessageSuite = require(\"message-suite-fisherman\")\nvar messageSuitePlugin = new MessageSuite({enableTyping: true, enableEmbedCompatibilityMode: true})\nbot.use(messageSuitePlugin)\n[...]\n```\n\n## Api docs\n\n### new MessageSuite(opts)\n\nCreates an instance of MessageSuite.\n\n### MessageSuite constructor options\n\n| Parameter name               | Description                                                                                                                       | Type     | Default value |\n|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|----------|---------------|\n| enableTyping                 | Enable typing when it's a command and response.send() is used                                                                     | Boolean  | false         |\n| defaultTypingCount           | Default typing count when no typing count is specified in the command's locales                                                   | Integer  | 1             |\n| defaultTimeout               | Default timeout in MS to send the message after starting typing when no timeout is specified in the command's locales                   | Integer  | 1000          |\n| enableEmbedCompatibilityMode | If it should enable the Compatibilty mode, it will send formatted text instead of an embed if the bot hasn't the perm EMBED_LINKS | Boolean  | true          |\n| embedCompatibilityModeFormat | The function used to convert the embed to formatted text                                                                          | Function | defaultFormat |\n\n### Setting the embedCompatibilityModeFormat options\n\nThis parameter is an option used to parse the embed.\n\nThe default value is a simple function who looks like this:\n\n```javascript\n  defaultFormat (embed) {\n    var formatted = ''\n    if (embed.title) formatted = formatted + '__' + embed.title + '__\\n'\n    if (embed.description) formatted = formatted + '\\n' + embed.description + '\\n'\n    if (embed.fields) for (var i in embed.fields)formatted = formatted + '=\u003e **' + embed.fields[i].name + '**\\n ' + embed.fields[i].value + '\\n'\n    return formatted\n  }\n```\n\nThe `embed` parameter is an Object. This function has to return a string value\n\n## Custom timeout and typing count in the command locales property\n\nYou can set as well the timeout and the typing count in the command's locales property:\n\nExample with a timeout of `5s` and a typing count of `1`\n\n```javascript\nregister.textCommand('test', {locales: {typingCount:1, typingTimeout:5000}}, function (req, res) {\n  console.log(\"Command trigerred\")\n  var embed = {\n    title: \"a test\",\n    description: \"Just a simple test\",\n    fields: [{name: \"Cat title\", value: \"Guoi daziou duoaoauj dqiupou\"},{name: \"Cat title\", value: \"Guoi daziou duoaoauj dqiupou\"}]\n  }\n  res.send(\"ok\", {embed: embed})\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxerbox%2Fmessage-suite-fisherman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxerbox%2Fmessage-suite-fisherman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxerbox%2Fmessage-suite-fisherman/lists"}