event-local
Version:
Event client
49 lines (39 loc) • 1.12 kB
text/typescript
import { EventHeandlerMethod, MessageHeandlerMethod, API } from "./EventCore";
import EventLocal from './EventLocal';
export class RExempleService {
property = "property";
hello: string;
constructor(r: string) {
this.hello = r;
}
("messager.send")
public send(s: string) {
if(process.env.TELEGRAM_ENABLE !== "1") return console.log("Не поддерживаю телеграм");
let message = JSON.parse(s);
new EventLocal().sendMessage(message.chat_id, message.message)
}
("orderService.Create")
public Create(s: string) {
console.log(s);
}
("testService.Update")
public Update(s: string) {
console.log(s);
}
(/^Привет,\s(.+)/i)
public OtherCommand(s: string) {
console.log(s);
}
(/^Документы,\s(.+)/i)
public BooleanCommand(s: string) {
console.log(s);
return s === "pnl";
}
('get','/')
public Main(req,res) {
res.send('успех');
}
Eventhandler(value: number): number {
return value;
}
}