Skip to content

Commit

Permalink
fix: 依存関係の更新と微修正 (#243)
Browse files Browse the repository at this point in the history
* chore: Remove pm2

* chore: Bump typescript

* chore: Bump jest

* fix: Fix for new typing
  • Loading branch information
MikuroXina authored Jun 7, 2022
1 parent bba6e10 commit 2310146
Show file tree
Hide file tree
Showing 4 changed files with 814 additions and 1,839 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-markdown": "^2.2.1",
"jest": "^27.5.1",
"jest": "^28.1.1",
"lint-staged": "^13.0.0",
"pm2": "^5.2.0",
"prettier": "^2.6.2",
"ts-jest": "^27.1.4",
"ts-jest": "^28.0.4",
"ts-node": "^10.8.1",
"typescript": "^4.6.4"
"typescript": "^4.7.3"
}
}
6 changes: 5 additions & 1 deletion src/adaptor/message-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export class MessageUpdateProxy<M> implements MessageUpdateEventProvider<M> {

onMessageUpdate(handler: (before: M, after: M) => Promise<void>): void {
const mapped = this.transformer((args) => handler(...args));
this.client.on('messageUpdate', (before, after) => mapped([before, after]));
this.client.on('messageUpdate', async (before, after) => {
if (after) {
await mapped([before, after]);
}
});
}
}
8 changes: 5 additions & 3 deletions src/adaptor/role-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const roleProxy = (
runner: RoleResponseRunner<AllRoleModel>
) => {
client.on('roleCreate', (role) => runner.triggerEvent('CREATE', map(role)));
client.on('roleUpdate', (_, role) =>
runner.triggerEvent('UPDATE', map(role))
);
client.on('roleUpdate', async (_, role) => {
if (role) {
await runner.triggerEvent('UPDATE', map(role));
}
});
};
Loading

0 comments on commit 2310146

Please sign in to comment.