vegapokerbot/internal/handler/wizard/add_chat_member_state.go

32 lines
836 B
Go
Raw Normal View History

2024-05-13 17:18:22 +03:00
package wizard
import (
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/fsm"
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/handler/iface"
)
const AddChatMemberStateID fsm.StateID = "add_chat_member"
type AddChatMemberState struct {
State
}
func NewAddChatMemberState(app iface.App) fsm.IState[Wizard] {
return &AddChatMemberState{newBase(app)}
}
func (s *AddChatMemberState) Enter(pl *Wizard, mc fsm.MachineControls[*Wizard]) error {
if pl.Data.MyChatMember == nil {
_ = mc.Move(WaitingForMemberWebhookStateID, pl)
}
return nil
}
func (s *AddChatMemberState) Handle(pl *Wizard, mc fsm.MachineControls[*Wizard]) {
// todo: copy implementation from func (h *ChatMemberUpdatedHandler) handleAddToChat(tgChat telego.Chat) error
}
func (s *AddChatMemberState) ID() fsm.StateID {
return AddChatMemberStateID
}