vegapokerbot/internal/handler/wizard/remove_chat_member_state.go
Neur0toxine 77eaceb152
All checks were successful
continuous-integration/drone/push Build is passing
move more logic to fsm
2024-05-13 17:18:22 +03:00

32 lines
868 B
Go

package wizard
import (
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/fsm"
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/handler/iface"
)
const RemoveChatMemberStateID fsm.StateID = "remove_chat_member"
type RemoveChatMemberState struct {
State
}
func NewRemoveChatMemberState(app iface.App) fsm.IState[Wizard] {
return &RemoveChatMemberState{newBase(app)}
}
func (s *RemoveChatMemberState) Enter(pl *Wizard, mc fsm.MachineControls[*Wizard]) error {
if pl.Data.MyChatMember == nil {
_ = mc.Move(WaitingForMemberWebhookStateID, pl)
}
return nil
}
func (s *RemoveChatMemberState) Handle(pl *Wizard, mc fsm.MachineControls[*Wizard]) {
// todo: copy implementation from func (h *ChatMemberUpdatedHandler) handleRemoveFromChat(tgChat telego.Chat) error
}
func (s *RemoveChatMemberState) ID() fsm.StateID {
return RemoveChatMemberStateID
}