Skip to content

Commit

Permalink
Update readme file
Browse files Browse the repository at this point in the history
Signed-off-by: aliwoto <aminnimaj@gmail.com>
  • Loading branch information
ALiwoto committed Feb 2, 2022
1 parent 9ba569e commit 24c9620
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</p>

> Name: Rate Limiter \
> Version: v1.0.0 \
> Edit: 12 Sep 2021 \
> Version: v1.0.6 \
> Edit: 2 Feb 2021 \
> By: ALiwoto and Contributors (C)
[![Go Reference](https://pkg.go.dev/badge/github.com/gotgbot/ratelimiter.svg)](https://pkg.go.dev/github.com/gotgbot/ratelimiter) [![Go-linux](https://github.com/gotgbot/ratelimiter/actions/workflows/go-linux.yml/badge.svg)](https://github.com/gotgbot/ratelimiter/actions/workflows/go-linux.yml) [![Go-macos](https://github.com/gotgbot/ratelimiter/actions/workflows/go-macos.yml/badge.svg)](https://github.com/gotgbot/ratelimiter/actions/workflows/go-macos.yml) [![Go-windows](https://github.com/gotgbot/ratelimiter/actions/workflows/go-windows.yml/badge.svg)](https://github.com/gotgbot/ratelimiter/actions/workflows/go-windows.yml)
Expand All @@ -46,16 +46,24 @@ func loadLimiter(d *ext.Dispatcher) {
ConsiderEdits: false,
IgnoreMediaGroup: true,
TextOnly: false,
HandlerGroups: []int{0, 1, 2},
})

// 14 messages per 6 seconds
limiter.SetFloodWaitTime(6 * time.Second)
limiter.SetMaxMessageCount(14)

// add sudo users as exceptions, so they don't get rate-limited by library.
// add sudo users as exceptions, so they don't get rate-limited by library
limiter.AddExceptionID(sudoUsers...)

kv.KigCore.Limiter.Start()
limiter.Start()
}
```

<hr/>

## Helpful links:

- [Support group on telegram](https://t.me/KaizokuBots)
- [Contact maintainer on telegram](https://t.me/Falling_inside_The_Black)

1 change: 1 addition & 0 deletions tests/ratelimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func loadHandlers(d *ext.Dispatcher) {
ConsiderEdits: false,
IgnoreMediaGroup: true,
TextOnly: false,
HandlerGroups: []int{0, 1, 2},
})
limiter.SetTriggerFuncs(limitedTrigger)
limiter.Start()
Expand Down

0 comments on commit 24c9620

Please sign in to comment.