feat: add NFT usernames and bot verification (#22)
Implements collectible usernames, official verification workflows, and third-party bot verification after maintainer protocol and migration review. The composite activity/moderation rating remains an admin-only read model; Telegram Stars Rating wire fields stay unset pending a dedicated official-semantics implementation. Reviewed-Head: 2796345775ea0f908fb7734601e5e1dee4b653b9 Original-Head: fa082b892fd5180c9c9bc53c81c21cf5d250a75b Co-authored-by: Egor Egorov <business.egor.sg@gmail.com>
This commit is contained in:
parent
b0fd3976f1
commit
fff8de783a
169 changed files with 55769 additions and 282 deletions
|
|
@ -28,6 +28,31 @@ func rightsNotModifiedErr() error { return tgerr.New(400, "RIGHTS_NOT_MOD
|
|||
func botVerifierForbiddenErr() error { return tgerr.New(403, "BOT_VERIFIER_FORBIDDEN") }
|
||||
func userPermissionDeniedErr() error { return tgerr.New(403, "USER_PERMISSION_DENIED") }
|
||||
|
||||
// setCustomVerificationErr maps the third-party verification domain errors onto TL.
|
||||
//
|
||||
// The public method documents only BOT_INVALID, BOT_VERIFIER_FORBIDDEN and
|
||||
// PEER_ID_INVALID. Domain detail must not leak invented error names that official
|
||||
// clients do not handle.
|
||||
func setCustomVerificationErr(err error) error {
|
||||
switch {
|
||||
case errors.Is(err, domain.ErrVerifierForbidden),
|
||||
errors.Is(err, domain.ErrVerifierNotFound),
|
||||
errors.Is(err, domain.ErrVerificationIconNotFound),
|
||||
errors.Is(err, domain.ErrVerificationIconInactive),
|
||||
errors.Is(err, domain.ErrVerificationIconInvalid),
|
||||
errors.Is(err, domain.ErrVerifierDescriptionForbidden),
|
||||
errors.Is(err, domain.ErrCustomVerificationRequestInvalid),
|
||||
errors.Is(err, domain.ErrCustomVerificationLimit):
|
||||
return botVerifierForbiddenErr()
|
||||
case errors.Is(err, domain.ErrCustomVerificationTargetInvalid):
|
||||
return peerIDInvalidErr()
|
||||
case errors.Is(err, domain.ErrBotNotFound), errors.Is(err, domain.ErrVerifierSettingsInvalid):
|
||||
return botInvalidErr()
|
||||
default:
|
||||
return internalErr()
|
||||
}
|
||||
}
|
||||
|
||||
func setBotCommandsErr(err error) error {
|
||||
if errors.Is(err, domain.ErrBotCommandInvalid) {
|
||||
return botCommandInvalidErr()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue