feat: telegram bot (#238)

This commit is contained in:
Dream Hunter
2024-05-16 12:57:23 +08:00
committed by GitHub
parent 6bb6fa8298
commit 78badf2eaa
23 changed files with 844 additions and 57 deletions

View File

@@ -36,7 +36,12 @@ api.post('/admin/new_address', async (c) => {
if (!name) {
return c.text("Please provide a name", 400)
}
return newAddress(c, name, domain, enablePrefix);
try {
const res = await newAddress(c, name, domain, enablePrefix);
return c.json(res);
} catch (e) {
return c.text(`Failed create address: ${e.message}`, 400)
}
})
api.delete('/admin/delete_address/:id', async (c) => {