mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 23:22:56 +00:00
feat: icon change event
This commit is contained in:
parent
b19bc1567d
commit
c366a7eb01
1 changed files with 30 additions and 0 deletions
30
src/commands/iconlogger.ts
Normal file
30
src/commands/iconlogger.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import util from "util";
|
||||
import { Command, onlyForMe } from "../modules/BaseCommand";
|
||||
import { ModifiedApp } from "../modules/slackapp";
|
||||
|
||||
export default class IconLogger implements Command {
|
||||
name: string;
|
||||
description: string;
|
||||
is_event?: boolean;
|
||||
constructor() {
|
||||
this.name = "team_profile_change";
|
||||
this.description = `new icon??`;
|
||||
this.is_event = true;
|
||||
}
|
||||
run(app: ModifiedApp) {
|
||||
// app.command()
|
||||
app.event(this.name, async ({ event }) => {
|
||||
console.debug(event);
|
||||
// try {
|
||||
//@ts-ignore
|
||||
const { profile } = event;
|
||||
if (profile && profile.icon) {
|
||||
await app.client.chat.postMessage({
|
||||
channel: `C08AUQ4AZL5`,
|
||||
text: `:tada: New icon! ${profile.icon}`,
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue