users

package
v0.0.0-...-3723a19 Latest Latest
Warning

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

Go to latest
Published: May 19, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ac *appcontext.Context)

New is a appcontext initialization function

Types

type Users

type Users struct{}

Users is a function-handling struct for users

func (*Users) FindByLevel

func (u *Users) FindByLevel(update *tgbotapi.Update) string

FindByLevel finds user with level and recent profile update

func (*Users) FindByName

func (u *Users) FindByName(update *tgbotapi.Update) string

FindByName finds user with such username or nickname

func (*Users) FindByTopAttack

func (u *Users) FindByTopAttack(update *tgbotapi.Update) string

FindByTopAttack finds user by top-attack rating

func (*Users) ForeignProfileMessage

func (u *Users) ForeignProfileMessage(update *tgbotapi.Update) string

ForeignProfileMessage shows profile of another user

func (*Users) FormatUsername

func (u *Users) FormatUsername(userName string) string

FormatUsername formats Telegram username for posting

func (*Users) GetPrettyName

func (u *Users) GetPrettyName(user *tgbotapi.User) string

GetPrettyName returns "pretty" name of user (first_name + last name or username)

func (*Users) Init

func (u *Users) Init()

Init is an initialization function for users

func (*Users) ParseProfile

func (u *Users) ParseProfile(update *tgbotapi.Update, playerRaw *dbmapping.Player) string

ParseProfile parses user profile, forwarded from PokememBroBot, to database

func (*Users) PlayerBetterThan

func (u *Users) PlayerBetterThan(playerRaw *dbmapping.Player, powerLevel string) bool

PlayerBetterThan return true, if profile is more or equal powerful than provided power level

func (*Users) ProfileMessage

func (u *Users) ProfileMessage(update *tgbotapi.Update, playerRaw *dbmapping.Player) string

ProfileMessage shows current player's profile

func (*Users) UsersList

func (u *Users) UsersList(update *tgbotapi.Update) string

UsersList lists all known users

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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