{"id":18251726,"url":"https://github.com/moqada/gbas","last_synced_at":"2026-05-07T10:32:57.656Z","repository":{"id":152605262,"uuid":"606671147","full_name":"moqada/gbas","owner":"moqada","description":":robot: Generic Bot Adapter for Slack next-gen platform","archived":false,"fork":false,"pushed_at":"2024-04-03T14:57:28.000Z","size":431,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-30T21:29:29.513Z","etag":null,"topics":["bot","deno","slack"],"latest_commit_sha":null,"homepage":"https://deno.land/x/gbas","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/moqada.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-26T07:36:01.000Z","updated_at":"2023-07-10T03:28:37.000Z","dependencies_parsed_at":"2024-11-05T09:49:16.234Z","dependency_job_id":"c478e1b3-809f-4461-ba6f-7c1685bd8097","html_url":"https://github.com/moqada/gbas","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/moqada/gbas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqada%2Fgbas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqada%2Fgbas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqada%2Fgbas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqada%2Fgbas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moqada","download_url":"https://codeload.github.com/moqada/gbas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqada%2Fgbas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273983073,"owners_count":25202092,"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-09-06T02:00:13.247Z","response_time":2576,"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","deno","slack"],"created_at":"2024-11-05T09:48:21.275Z","updated_at":"2026-05-07T10:32:57.607Z","avatar_url":"https://github.com/moqada.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GBAS\n\nThis is an adapter for easily creating generic bots on the Slack Next-gen\nplatform that respond to mentions, messages, and emojis.\n\n## Getting Started\n\nFirst, prepare a Slack Next-gen platform app.\n\nYou can create a new one using the `slack create` command. For more information,\nplease refer to\n[the official Slack documentation](https://api.slack.com/future/create).\n\nThen navigate to the slack project directory, run the following:\n\n```\ndeno run -Ar https://deno.land/x/gbas/init.ts\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eActually command output example\u003c/summary\u003e\n\n```zsh\n┗╸❯❯❯ slack create sample\n⚙️  Creating a new Slack app in ~/sample\n\n📦 Installed project dependencies\n\n✨ sample successfully created\n\n🧭 Explore the documentation to learn more\n   Read the README.md or peruse the docs over at api.slack.com/future\n   Find available commands and usage info with slack help\n\n📋 Follow the steps below to begin development\n   Change into your project directory with cd sample/\n   Develop locally and see changes in real-time with slack run\n   When you're ready to deploy for production use slack deploy\n\n┗╸❯❯❯ cd sample\n\n┗╸❯❯❯ deno run -Ar https://deno.land/x/gbas/init.ts\n🎉 Successfully created bot code.\n\nYou must edit bot/config.ts.\n\n1. Change CHANNEL_IDS in bot/config.ts.\n2. Add your first command by `deno run -Ar https://deno.land/x/gbas/command.ts`\n3. Develop locally with `slack run`.\n```\n\n\u003c/details\u003e\n\nFor more examples, please refer to the [examples](/examples) directory.\n\n## Usage\n\nImplement each function as a command.\n\nYou can scaffold code by running the following:\n\n```\ndeno run -Ar https://deno.land/x/gbas/command.ts\n```\n\n### Mention Command\n\nTo create a command that responds to mentions, use the following implementation:\n\n```ts\nimport { createMentionCommand } from \"gbas/mod.ts\";\n\nexport const echo = createMentionCommand({\n  name: \"echo\",\n  examples: [\"echo \u003cmessage\u003e - echo applied message\"],\n  pattern: /^echo\\s*(.+)$/i,\n  execute: (c) =\u003e c.res.message(c.match[1]),\n});\n```\n\nYou can write a test for the command like this:\n\n```ts\nimport { createMentionCommandTester } from \"gbas/mod.ts\";\nimport { assert, assertEquals } from \"std/testing/asserts.ts\";\nimport { echo } from \"./echo.ts\";\n\nconst { createContext, dispatch } = createMentionCommandTester(echo);\n\nDeno.test(\"echo\", async () =\u003e {\n  const res = await dispatch(createContext(\"\u003c@BOT\u003e echo hello world\"));\n  assert(res.type === \"message\");\n  assertEquals(res.text, \"hello world\");\n});\n```\n\n### Message Command\n\nTo create a command that responds to messages, use the following implementation:\n\n```ts\nimport { createMessageCommand } from \"gbas/mod.ts\";\n\nexport const hello = createMessageCommand({\n  name: \"hello\",\n  examples: [\"hello - reaction emoji\"],\n  pattern: /^hello$/i,\n  execute: (c) =\u003e c.res.reaction(\"hugging_face\"),\n});\n```\n\nYou can write a test for the command like this:\n\n```ts\nimport { createMessageCommandTester } from \"gbas/mod.ts\";\nimport { assert, assertEquals } from \"std/testing/asserts.ts\";\nimport { hello } from \"./hello.ts\";\n\nconst { createContext, dispatch } = createMessageCommandTester(echo);\n\nDeno.test(\"hello\", async () =\u003e {\n  const c = createContext(\"hello\");\n  const res = await dispatch(c);\n  assert(res.type === \"reaction\");\n  assertEquals(res.emoji, \"hugging_face\");\n});\n```\n\n### Reaction Command\n\nTo create a command that responds to reactions (emojis), use the following\nimplementation:\n\n```ts\nimport { createReactionCommand } from \"gbas/mod.ts\";\n\nexport const owl = createReactionCommand({\n  name: \"owl\",\n  examples: [\":owl: - reply hoot\"],\n  emojis: [\"owl\"],\n  execute: (c) =\u003e c.res.message(\"hoot!\", { mentionUserIds: [c.event.userId] }),\n});\n```\n\nYou can write a test for the command like this:\n\n```ts\nimport { createReactionCommandTester } from \"gbas/mod.ts\";\nimport { assert, assertEquals } from \"std/testing/asserts.ts\";\nimport { owl } from \"./owl.ts\";\n\nconst { createContext, dispatch } = createReactionCommandTester(owl);\n\nDeno.test(\"owl\", async () =\u003e {\n  const c = createContext(\"owl\");\n  const res = await dispatch(c);\n  assert(res.type === \"message\");\n  assertEquals(res.text, \"\u003c@USER\u003e hoot!\");\n});\n```\n\n## Development\n\n- Test: `deno task test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoqada%2Fgbas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoqada%2Fgbas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoqada%2Fgbas/lists"}