feat(telegram): integrate Telegram bot for notifications and add related models
This commit is contained in:
@@ -319,3 +319,23 @@ export function importPeriodicExpenses(file: File): Promise<ImportResult> {
|
||||
return r.json();
|
||||
});
|
||||
}
|
||||
|
||||
// Telegram
|
||||
|
||||
export type TelegramStatus = {
|
||||
botUsername: string | null;
|
||||
connected: boolean;
|
||||
};
|
||||
|
||||
export type TelegramCode = {
|
||||
code: string;
|
||||
botUsername: string | null;
|
||||
};
|
||||
|
||||
export function getTelegramStatus(): Promise<TelegramStatus> {
|
||||
return fetcher<TelegramStatus>("/api/telegram/status");
|
||||
}
|
||||
|
||||
export function generateTelegramCode(): Promise<TelegramCode> {
|
||||
return mutator<TelegramCode>("/api/telegram/code", "POST");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user