update config functions
This commit is contained in:
parent
950605b129
commit
ebd3baef1f
8
bot.go
8
bot.go
@ -914,6 +914,14 @@ func botUserConfigPillage(m *ChatWarsMessage, set bool) {
|
||||
return
|
||||
}
|
||||
|
||||
func botUserConfigWartime(m *ChatWarsMessage, set string) {
|
||||
clt, _ := getLockedClient(m.TGUserID64, false)
|
||||
clt.Config.Wartime = set
|
||||
clt.Mux.Unlock()
|
||||
botUserConfig(m)
|
||||
return
|
||||
}
|
||||
|
||||
func botUserConfig(m *ChatWarsMessage) {
|
||||
clt, _ := getLockedClient(m.TGUserID64, false)
|
||||
clt.Mux.Unlock()
|
||||
|
@ -674,6 +674,16 @@
|
||||
"name": "Set User Config Pillage OFF",
|
||||
"obj_type": "msg"
|
||||
},
|
||||
{
|
||||
"intl_id": "msg_bot_user_config_def_guild",
|
||||
"name": "Set User Config DEF GUILD",
|
||||
"obj_type": "msg"
|
||||
},
|
||||
{
|
||||
"intl_id": "msg_bot_user_config_def_castle",
|
||||
"name": "Set User Config DEF CASTLE",
|
||||
"obj_type": "msg"
|
||||
},
|
||||
{
|
||||
"intl_id": "msg_unknown_action",
|
||||
"name": "Set Unknown Action",
|
||||
|
20
rules.go
20
rules.go
@ -81,6 +81,26 @@ func resetMsgParsingRules() error {
|
||||
}
|
||||
rules2 = append(rules2, r)
|
||||
|
||||
r = MessageParsingRule{
|
||||
Priority: 9999,
|
||||
Description: "Config",
|
||||
Rule: "^/config_def_guild$",
|
||||
MsgTypeID64: cacheObjSubType[`msg_bot_user_config_def_guild`],
|
||||
ChatID64: id,
|
||||
SenderUserID64: id,
|
||||
}
|
||||
rules2 = append(rules2, r)
|
||||
|
||||
r = MessageParsingRule{
|
||||
Priority: 9999,
|
||||
Description: "Config",
|
||||
Rule: "^/config_def_castle$",
|
||||
MsgTypeID64: cacheObjSubType[`msg_bot_user_config_def_castle`],
|
||||
ChatID64: id,
|
||||
SenderUserID64: id,
|
||||
}
|
||||
rules2 = append(rules2, r)
|
||||
|
||||
r = MessageParsingRule{
|
||||
Priority: 9999,
|
||||
Description: "Alch your supply",
|
||||
|
@ -548,6 +548,10 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
|
||||
botUserConfigPillage(m, true)
|
||||
case cacheObjSubType[`msg_bot_user_config_pillage_off`]:
|
||||
botUserConfigPillage(m, false)
|
||||
case cacheObjSubType[`msg_bot_user_config_def_guild`]:
|
||||
botUserConfigWartime(m, `/g_def`)
|
||||
case cacheObjSubType[`msg_bot_user_config_def_castle`]:
|
||||
botUserConfigWartime(m, `🛡Defend`)
|
||||
case cacheObjSubType[`msg_bot_shutdown`]:
|
||||
botShutdown()
|
||||
case cacheObjSubType[`msg_bot_rage_up`]:
|
||||
|
Loading…
Reference in New Issue
Block a user