Documentation ¶
Index ¶
- func RateLimitCall(id int64, duration time.Duration) bool
- type Datastore
- type Dependency
- func (d *Dependency) AreWe(ctx context.Context, chatID int64) (bool, error)
- func (d *Dependency) DisableUnderAttackModeHandler(ctx context.Context, c tb.Context) error
- func (d *Dependency) EnableUnderAttackModeHandler(ctx context.Context, c tb.Context) error
- func (d *Dependency) Kicker(ctx context.Context, c tb.Context) error
- type UnderAttack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Datastore ¶
type Datastore interface { Migrate(ctx context.Context) error GetUnderAttackEntry(ctx context.Context, groupID int64) (UnderAttack, error) CreateNewEntry(ctx context.Context, groupID int64) error SetUnderAttackStatus(ctx context.Context, groupID int64, underAttack bool, expiresAt time.Time, notificationMessageID int64) error Close() error }
type Dependency ¶
Dependency contains the dependency injection struct for methods in the UnderAttack package
func (*Dependency) DisableUnderAttackModeHandler ¶
DisableUnderAttackModeHandler provides a handler for /disableunderattack command.
func (*Dependency) EnableUnderAttackModeHandler ¶
EnableUnderAttackModeHandler provides a handler for /UnderAttack command.
type UnderAttack ¶
type UnderAttack struct { GroupID int64 `db:"group_id"` IsUnderAttack bool `db:"is_under_attack"` NotificationMessageID int64 `db:"notification_message_id"` ExpiresAt time.Time `db:"expires_at"` UpdatedAt time.Time `db:"updated_at"` }
UnderAttack provides a data struct to interact with the database table.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.