Commit 7bbfceb1 authored by nanahira's avatar nanahira

add more basic things

parent d5c9d705
Pipeline #3221 passed with stages
in 1 minute and 6 seconds
...@@ -88,4 +88,28 @@ export class BotService { ...@@ -88,4 +88,28 @@ export class BotService {
getBot() { getBot() {
return (this.bot.bots[0] as unknown) as CQBot; return (this.bot.bots[0] as unknown) as CQBot;
} }
async sendPrivateMessage(id: string, message: string) {
try {
await this.getBot().$sendPrivateMsg(id, message);
return true;
} catch (e) {
this.log.error(
`Failed to send private message ${message} to ${id}: ${e.toString()}`,
);
return false;
}
}
async sendGroupMessage(id: string, message: string) {
try {
await this.getBot().$sendGroupMsg(id, message);
return true;
} catch (e) {
this.log.error(
`Failed to send group message ${message} to ${id}: ${e.toString()}`,
);
return false;
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment