access

package
v0.0.0-...-fb114ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role uint8
const (
	Guest Role = 100 - iota
	Bot
	Banned

	Admin Role = 255 - iota
	Friend
	Known
)

type User

type User struct {
	*tgbotapi.User

	FromChatID  int64  `json:"from_chat_id"`
	FriendToken string `json:"friend_token,omitempty"`
	Role        Role   `json:"role"`
}

func NewUser

func NewUser(user *tgbotapi.User) *User

func NewUserFromJSON

func NewUserFromJSON(data []byte) (*User, error)

func (*User) IsAdmin

func (u *User) IsAdmin() bool

func (*User) IsBanned

func (u *User) IsBanned() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL