Skip to content

Commit

Permalink
Fix typos.
Browse files Browse the repository at this point in the history
Signed-off-by: Aliwoto <woto@kaizoku.cyou>
  • Loading branch information
Aliwoto committed May 17, 2023
1 parent 50fb3e0 commit 6ca57ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (l *Limiter) Stop() {
// make sure that mutex is not nil.
if l.mutex != nil {
// let another goroutines let go of the mutex;
// if you set the usermap value to nil out of nowhere
// if you set the userMap value to nil out of nowhere
// it MAY cause some troubles.
l.mutex.Lock()
l.userMap = nil
Expand Down Expand Up @@ -167,7 +167,7 @@ func (l *Limiter) AddExceptionID(id ...int64) {

// AddCondition will add a condition to be checked by this limiter,
// if this condition doesn't return true, the limiter won't check
// the message for antifloodwait.
// the message for anti-flood-wait.
func (l *Limiter) AddCondition(condition filters.Message) {
l.conditions = append(l.conditions, condition)
}
Expand Down Expand Up @@ -197,9 +197,9 @@ func (l *Limiter) ClearAllExceptionIDs() {
l.exceptionIDs = nil
}

// IsInExcpetionList will check and see if an ID is in the
// IsInExceptionList will check and see if an ID is in the
// exception list of the listener or not.
func (l *Limiter) IsInExcpetionList(id int64) bool {
func (l *Limiter) IsInExceptionList(id int64) bool {
if len(l.exceptionIDs) == 0 {
return false
}
Expand Down Expand Up @@ -260,7 +260,7 @@ func (l *Limiter) SetPunishmentDuration(d time.Duration) {
}

// SetMaxMessageCount sets the possible messages count in the
// antifloodwait amount of time (which is `l.timeout`).
// anti-flood-wait amount of time (which is `l.timeout`).
// in that period of time, chat (or user) needs to send less than
// this much message, otherwise they will be limited by this limiter
// and so as a result of that their messages will be ignored by the bot.
Expand Down
4 changes: 2 additions & 2 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type Limiter struct {
// as its key (int64).
userMap map[int64]*UserStatus

// trigger function will be runned when a user is limited
// trigger function will run when a user is limited
// by the limiter. It should be set by user, users can do everything
// they want in this function, such as logging the person's id who
// has been limited by the limiter, etc...
Expand Down Expand Up @@ -109,7 +109,7 @@ type Limiter struct {
// any messages to the bot until it's limit time is completely over.
// otherwise the limitation will remain on the user until it stops
// sending any messages to the bot.
// (A truly bad way of handling antifloodwait... we recommend not to
// (A truly bad way of handling anti-floodwait... we recommend not to
// set this value to `true`, unless it's very very necessary).
IsStrict bool

Expand Down

0 comments on commit 6ca57ed

Please sign in to comment.