koishi-plugin-githubsth 1.0.1-test2 → 1.0.1-test3

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.
@@ -1,7 +1,7 @@
1
1
  import { Context, Service, h } from 'koishi';
2
2
  declare module 'koishi' {
3
3
  interface Context {
4
- formatter: Formatter;
4
+ githubsthFormatter: Formatter;
5
5
  }
6
6
  }
7
7
  export declare class Formatter extends Service {
@@ -4,7 +4,7 @@ exports.Formatter = void 0;
4
4
  const koishi_1 = require("koishi");
5
5
  class Formatter extends koishi_1.Service {
6
6
  constructor(ctx) {
7
- super(ctx, 'formatter');
7
+ super(ctx, 'githubsthFormatter');
8
8
  }
9
9
  formatPush(payload) {
10
10
  const { repository, pusher, commits, compare } = payload;
@@ -2,7 +2,7 @@ import { Context, Service } from 'koishi';
2
2
  import { Config } from '../config';
3
3
  declare module 'koishi' {
4
4
  interface Context {
5
- notifier: Notifier;
5
+ githubsthNotifier: Notifier;
6
6
  }
7
7
  }
8
8
  export declare class Notifier extends Service {
@@ -5,7 +5,7 @@ const koishi_1 = require("koishi");
5
5
  class Notifier extends koishi_1.Service {
6
6
  // @ts-ignore
7
7
  constructor(ctx, config) {
8
- super(ctx, 'notifier', true);
8
+ super(ctx, 'githubsthNotifier', true);
9
9
  this.config = config;
10
10
  this.registerListeners();
11
11
  }
@@ -70,40 +70,40 @@ class Notifier extends koishi_1.Service {
70
70
  }
71
71
  let message = null;
72
72
  // Ensure formatter is loaded
73
- if (!this.ctx.formatter) {
73
+ if (!this.ctx.githubsthFormatter) {
74
74
  this.ctx.logger('notifier').warn('Formatter service not available');
75
75
  return;
76
76
  }
77
77
  switch (event) {
78
78
  case 'push':
79
- message = this.ctx.formatter.formatPush(payload);
79
+ message = this.ctx.githubsthFormatter.formatPush(payload);
80
80
  break;
81
81
  case 'issues':
82
- message = this.ctx.formatter.formatIssue(payload);
82
+ message = this.ctx.githubsthFormatter.formatIssue(payload);
83
83
  break;
84
84
  case 'pull_request':
85
- message = this.ctx.formatter.formatPullRequest(payload);
85
+ message = this.ctx.githubsthFormatter.formatPullRequest(payload);
86
86
  break;
87
87
  case 'star':
88
- message = this.ctx.formatter.formatStar(payload);
88
+ message = this.ctx.githubsthFormatter.formatStar(payload);
89
89
  break;
90
90
  case 'fork':
91
- message = this.ctx.formatter.formatFork(payload);
91
+ message = this.ctx.githubsthFormatter.formatFork(payload);
92
92
  break;
93
93
  case 'release':
94
- message = this.ctx.formatter.formatRelease(payload);
94
+ message = this.ctx.githubsthFormatter.formatRelease(payload);
95
95
  break;
96
96
  case 'discussion':
97
- message = this.ctx.formatter.formatDiscussion(payload);
97
+ message = this.ctx.githubsthFormatter.formatDiscussion(payload);
98
98
  break;
99
99
  case 'workflow_run':
100
- message = this.ctx.formatter.formatWorkflowRun(payload);
100
+ message = this.ctx.githubsthFormatter.formatWorkflowRun(payload);
101
101
  break;
102
102
  case 'issue_comment':
103
- message = this.ctx.formatter.formatIssueComment(payload);
103
+ message = this.ctx.githubsthFormatter.formatIssueComment(payload);
104
104
  break;
105
105
  case 'pull_request_review':
106
- message = this.ctx.formatter.formatPullRequestReview(payload);
106
+ message = this.ctx.githubsthFormatter.formatPullRequestReview(payload);
107
107
  break;
108
108
  }
109
109
  if (!message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-githubsth",
3
- "version": "1.0.1-test2",
3
+ "version": "1.0.1-test3",
4
4
  "description": "Github Subscriptions Notifications, push notifications for GitHub subscriptions For koishi",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",