This commit is contained in:
shoopea 2021-01-21 15:20:08 +01:00
parent dacf07b53b
commit 82d6988ffd

View File

@ -170,6 +170,20 @@ func resetMsgParsingRules() error {
BotCommand: true, BotCommand: true,
} }
rules2 = append(rules2, r) rules2 = append(rules2, r)
if len(o.Craft.Command) > 6 && o.Craft.Command[0:4] == "/brew_" {
fmt.Printf("Inserting %s\n", o.Code)
r = MessageParsingRule{
Priority: 9998,
Description: fmt.Sprintf("Specific item brew %s", o.Code),
Rule: fmt.Sprintf("^\\/alch_(?P<Code>%s)$", regexp.QuoteMeta(o.Code)),
MsgTypeID64: cacheObjSubType[`msg_bot_brew_item`],
ChatID64: 0,
SenderUserID64: users[id],
BotCommand: true,
}
rules2 = append(rules2, r)
}
} }
} }
muxObjItem.RUnlock() muxObjItem.RUnlock()
@ -218,24 +232,6 @@ func resetMsgParsingRules() error {
} }
rules2 = append(rules2, r) rules2 = append(rules2, r)
muxObjItem.RLock()
for _, o := range objItems {
if o.Craft != nil && o.ItemTypeID == cacheObjSubType[`item_misc`] && len(o.Craft.Command) > 6 && o.Craft.Command[0:5] == "/brew_" {
fmt.Printf("Inserting %s\n", o.Code)
r = MessageParsingRule{
Priority: 9998,
Description: fmt.Sprintf("Specific item brew %s", o.Code),
Rule: fmt.Sprintf("^\\/alch_(?P<Code>%s)$", regexp.QuoteMeta(o.Code)),
MsgTypeID64: cacheObjSubType[`msg_bot_brew_item`],
ChatID64: 0,
SenderUserID64: users[id],
BotCommand: true,
}
rules2 = append(rules2, r)
}
}
muxObjItem.RUnlock()
r = MessageParsingRule{ r = MessageParsingRule{
Priority: 9999, Priority: 9999,
Description: "List exchange deals on hold", Description: "List exchange deals on hold",