Add telegram bot
This commit is contained in:
22
frontend/src/api/telegram.ts
Normal file
22
frontend/src/api/telegram.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import client from './client'
|
||||
|
||||
export interface TelegramLinkToken {
|
||||
token: string
|
||||
bot_url: string
|
||||
}
|
||||
|
||||
export interface TelegramStatus {
|
||||
telegram_id: number | null
|
||||
telegram_username: string | null
|
||||
}
|
||||
|
||||
export const telegramApi = {
|
||||
generateLinkToken: async (): Promise<TelegramLinkToken> => {
|
||||
const response = await client.post<TelegramLinkToken>('/telegram/generate-link-token')
|
||||
return response.data
|
||||
},
|
||||
|
||||
unlinkTelegram: async (): Promise<void> => {
|
||||
await client.post('/users/me/telegram/unlink')
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user