mirror of
https://github.com/whekin/household-bot.git
synced 2026-04-01 02:44:02 +00:00
feat(miniapp): carry overdue billing and admin role flows
This commit is contained in:
@@ -62,6 +62,12 @@ export interface BotWebhookServerOptions {
|
||||
handler: (request: Request) => Promise<Response>
|
||||
}
|
||||
| undefined
|
||||
miniAppDemoteMember?:
|
||||
| {
|
||||
path?: string
|
||||
handler: (request: Request) => Promise<Response>
|
||||
}
|
||||
| undefined
|
||||
miniAppUpdateOwnDisplayName?:
|
||||
| {
|
||||
path?: string
|
||||
@@ -234,6 +240,8 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
|
||||
options.miniAppUpsertUtilityCategory?.path ?? '/api/miniapp/admin/utility-categories/upsert'
|
||||
const miniAppPromoteMemberPath =
|
||||
options.miniAppPromoteMember?.path ?? '/api/miniapp/admin/members/promote'
|
||||
const miniAppDemoteMemberPath =
|
||||
options.miniAppDemoteMember?.path ?? '/api/miniapp/admin/members/demote'
|
||||
const miniAppUpdateOwnDisplayNamePath =
|
||||
options.miniAppUpdateOwnDisplayName?.path ?? '/api/miniapp/member/display-name'
|
||||
const miniAppUpdateMemberDisplayNamePath =
|
||||
@@ -328,6 +336,10 @@ export function createBotWebhookServer(options: BotWebhookServerOptions): {
|
||||
return await options.miniAppPromoteMember.handler(request)
|
||||
}
|
||||
|
||||
if (options.miniAppDemoteMember && url.pathname === miniAppDemoteMemberPath) {
|
||||
return await options.miniAppDemoteMember.handler(request)
|
||||
}
|
||||
|
||||
if (options.miniAppUpdateOwnDisplayName && url.pathname === miniAppUpdateOwnDisplayNamePath) {
|
||||
return await options.miniAppUpdateOwnDisplayName.handler(request)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user