mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-20 02:00:49 +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/),
|
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).
|
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
|
## [1.6.3] - 2021-11-30
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -55,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
- Stulbe integration for alerts
|
- 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.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.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
|
[1.6.1]: https://github.com/strimertul/strimertul/compare/v1.6.0...v1.6.1
|
||||||
|
|
|
@ -90,11 +90,16 @@ func NewBot(api *Client, config BotConfig) *Bot {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
lc := strings.ToLower(cmd)
|
lc := strings.ToLower(cmd)
|
||||||
if strings.HasPrefix(lcmessage, lc) {
|
if !strings.HasPrefix(lcmessage, lc) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
parts := strings.SplitN(lcmessage, " ", 2)
|
||||||
|
if parts[0] != lc {
|
||||||
|
continue
|
||||||
|
}
|
||||||
go cmdCustom(bot, cmd, data, message)
|
go cmdCustom(bot, cmd, data, message)
|
||||||
bot.lastMessage = time.Now()
|
bot.lastMessage = time.Now()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
bot.mu.Unlock()
|
bot.mu.Unlock()
|
||||||
|
|
||||||
if bot.config.EnableChatKeys {
|
if bot.config.EnableChatKeys {
|
||||||
|
|
Loading…
Reference in a new issue