sotobot 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/bot.d.ts CHANGED
@@ -1,15 +1,5 @@
1
1
  import { App } from '@octokit/app';
2
- import type { Octokit } from '@octokit/core';
3
- import type { EmitterWebhookEvent } from '@octokit/webhooks/types';
4
- type IssueCommentEvent = EmitterWebhookEvent<'issue_comment.created'> & {
5
- octokit: Octokit;
6
- };
7
- export interface CommandContext {
8
- octokit: Octokit;
9
- payload: IssueCommentEvent['payload'];
10
- args: string[];
11
- }
12
- export type CommandHandler = (context: CommandContext) => Promise<void>;
2
+ import { CommandHandler } from './commands.js';
13
3
  export interface BotOptions {
14
4
  name: string;
15
5
  }
@@ -19,4 +9,3 @@ export declare class Bot {
19
9
  addCommand(name: string | string[], fn: CommandHandler): void;
20
10
  handleRequest(request: Request): Promise<Response>;
21
11
  }
22
- export {};
@@ -0,0 +1,12 @@
1
+ import { Octokit } from '@octokit/core';
2
+ import { EmitterWebhookEvent } from '@octokit/webhooks/types';
3
+ type IssueCommentEvent = EmitterWebhookEvent<'issue_comment.created'> & {
4
+ octokit: Octokit;
5
+ };
6
+ export interface CommandContext {
7
+ octokit: Octokit;
8
+ payload: IssueCommentEvent['payload'];
9
+ args: string[];
10
+ }
11
+ export type CommandHandler = (context: CommandContext) => Promise<void>;
12
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/lib/main.d.ts CHANGED
@@ -6,3 +6,4 @@ export interface CreateBotOptions {
6
6
  bot: BotOptions;
7
7
  }
8
8
  export declare function createBot(options: CreateBotOptions): Bot;
9
+ export * from './commands.js';
package/lib/main.js CHANGED
@@ -18,3 +18,4 @@ export function createBot(options) {
18
18
  botCache.set(options, bot);
19
19
  return bot;
20
20
  }
21
+ export * from './commands.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sotobot",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "A serverless-focused GitHub bot framework.",
5
5
  "keywords": [
6
6
  "github",