diff --git a/README.md b/README.md index a6c1986..b598295 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ ChirpNestBot - -- [ ] Crontab : engine, user interface -- [ ] Impersonate - [ ] Items parsing/identification -- [ ] Withdrawal bot -- [x] Foray interception +- [ ] Auto identificate weight of items - [ ] Tribute interception +- [ ] Withdrawal bot +- [ ] Crontab : engine, user interface +- [ ] Resources hidding +- [ ] Resources auto destroy +- [ ] Crafting helper (rss, recipes, part) + valuation +- [ ] Vault snapshot/diff +- [ ] Vault valuation - [ ] Experience graphs & forecast -- [ ] Redis/eliminate map race conditions \ No newline at end of file +- [ ] Impersonate +- [x] Foray interception +- [x] Eliminate cache map race conditions \ No newline at end of file diff --git a/bot.go b/bot.go index 80de6fc..df2fdc7 100644 --- a/bot.go +++ b/bot.go @@ -30,6 +30,8 @@ func BotHandlers(b *tb.Bot) { b.Handle("/timer", botTimer) + b.Handle("/g_stock", botGStock) + b.Handle(tb.OnPhoto, botPhoto) b.Handle(tb.OnChannelPost, botChannelPost) b.Handle(tb.OnQuery, botQuery) @@ -229,6 +231,9 @@ func botListParsingRules(m *tb.Message) { } func botListParsingRule(m *tb.Message) { + if !m.Private() { + return + } r := regexp.MustCompile("^[0-9]+$") if r.MatchString(m.Payload) { i, _ := strconv.ParseInt(m.Payload, 10, 64) @@ -263,6 +268,19 @@ func botListParsingRule(m *tb.Message) { return } +func botGStock(m *tb.Message) { + if !m.Private() { + return + } + clientSendCWMsg(m.Chat.ID, "/g_stock_res") + clientSendCWMsg(m.Chat.ID, "/g_stock_alch") + clientSendCWMsg(m.Chat.ID, "/g_stock_misc") + clientSendCWMsg(m.Chat.ID, "/g_stock_rec") + clientSendCWMsg(m.Chat.ID, "/g_stock_parts") + clientSendCWMsg(m.Chat.ID, "/g_stock_other") + return +} + func botTimer(m *tb.Message) { r := regexp.MustCompile("^(?P([0-9]*(s|m|h))+) \"(?P(.*))\"$") if r.MatchString(m.Payload) {