match

package
v0.0.0-...-4a96510 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscordMatch

type DiscordMatch struct {
	Owner *dg.User

	Team1VCh           *dg.Channel
	Team2VCh           *dg.Channel
	MatchID            int32
	RecommendedChannel *dg.Channel
	ListeningMessage   *dg.Message
	Status             Status
	// contains filtered or unexported fields
}

func (*DiscordMatch) GetGuildId

func (m *DiscordMatch) GetGuildId() string

func (*DiscordMatch) GetRecommendedChannel

func (m *DiscordMatch) GetRecommendedChannel() (*dg.Channel, error)

TODO: More strictly state management or more get method to nil check

type DiscordMatchService

type DiscordMatchService struct {
	// contains filtered or unexported fields
}

func NewDiscordMatchService

func NewDiscordMatchService() *DiscordMatchService

func (*DiscordMatchService) AppendMembers

func (s *DiscordMatchService) AppendMembers(tchID string, dg_users []*dg.User) error

func (*DiscordMatchService) Create

func (s *DiscordMatchService) Create(tch *dg.Channel, owner *dg.User) (*DiscordMatch, error)

func (*DiscordMatchService) FilterAvailableVCh

func (s *DiscordMatchService) FilterAvailableVCh(chs []*dg.Channel) []*dg.Channel

func (*DiscordMatchService) GetMatchByTChID

func (s *DiscordMatchService) GetMatchByTChID(tchID string) (*DiscordMatch, error)

use cache if we need more performance (not map)

func (*DiscordMatchService) GetTeam

func (s *DiscordMatchService) GetTeam(tchID string) (Team1UserIDs []string, Team2UserIDs []string, err error)

func (*DiscordMatchService) IsListeningMessage

func (s *DiscordMatchService) IsListeningMessage(tchID, msgID string) bool

func (*DiscordMatchService) Remove

func (s *DiscordMatchService) Remove(tchID string) error

func (*DiscordMatchService) SetListeningMessage

func (s *DiscordMatchService) SetListeningMessage(tchID string, msg *dg.Message) error

func (*DiscordMatchService) SetVCh

func (s *DiscordMatchService) SetVCh(tchID string, vch *dg.Channel, team string) error

func (*DiscordMatchService) Shuffle

func (s *DiscordMatchService) Shuffle(tchID string) error

type DiscordUser

type DiscordUser struct {
	DgUser    *dg.User
	MatchUser *matchpb.User
}

TODO: Make service

type Status

type Status int
const (
	StateVCh1Setting Status = iota
	StateVCh2Setting
	StateTeamPreview
)

Jump to

Keyboard shortcuts

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