mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-18 01:50:50 +00:00
Fix twitch bot custom command checking
This commit is contained in:
parent
49db94406d
commit
19064ac2ca
2 changed files with 15 additions and 3 deletions
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [CURRENT]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Twitch bot: fixed command checking, previous matching only checked for prefix (eg. !verylong could be called by writing !verylonglongbaaah)
|
||||
|
||||
## [1.6.3] - 2021-11-30
|
||||
|
||||
### Added
|
||||
|
@ -55,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- Stulbe integration for alerts
|
||||
|
||||
[CURRENT]: https://github.com/strimertul/strimertul/compare/v1.6.3...HEAD
|
||||
[1.6.3]: https://github.com/strimertul/strimertul/compare/v1.6.2...v1.6.3
|
||||
[1.6.2]: https://github.com/strimertul/strimertul/compare/v1.6.1...v1.6.2
|
||||
[1.6.1]: https://github.com/strimertul/strimertul/compare/v1.6.0...v1.6.1
|
||||
|
|
|
@ -90,10 +90,15 @@ func NewBot(api *Client, config BotConfig) *Bot {
|
|||
continue
|
||||
}
|
||||
lc := strings.ToLower(cmd)
|
||||
if strings.HasPrefix(lcmessage, lc) {
|
||||
go cmdCustom(bot, cmd, data, message)
|
||||
bot.lastMessage = time.Now()
|
||||
if !strings.HasPrefix(lcmessage, lc) {
|
||||
continue
|
||||
}
|
||||
parts := strings.SplitN(lcmessage, " ", 2)
|
||||
if parts[0] != lc {
|
||||
continue
|
||||
}
|
||||
go cmdCustom(bot, cmd, data, message)
|
||||
bot.lastMessage = time.Now()
|
||||
}
|
||||
bot.mu.Unlock()
|
||||
|
||||
|
|
Loading…
Reference in a new issue