mirror of
https://github.com/nullnyat/NullcatChan.git
synced 2025-08-08 09:33:53 +09:00
Add welcome module
This commit is contained in:
29
src/modules/welcome/index.ts
Normal file
29
src/modules/welcome/index.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import 藍 from '../../ai';
|
||||
import IModule from '../../module';
|
||||
|
||||
export default class WelcomeModule implements IModule {
|
||||
public name = 'welcome';
|
||||
|
||||
private ai: 藍;
|
||||
|
||||
public install = (ai: 藍) => {
|
||||
this.ai = ai;
|
||||
}
|
||||
|
||||
public onLocalNote = (note: any) => {
|
||||
if (note.user.notesCount == 1) {
|
||||
setTimeout(() => {
|
||||
this.ai.api('notes/create', {
|
||||
renoteId: note.id
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
setTimeout(() => {
|
||||
this.ai.api('notes/reactions/create', {
|
||||
noteId: note.id,
|
||||
reaction: 'congrats'
|
||||
});
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user