This commit is contained in:
shoopea 2020-06-16 19:04:45 +02:00
parent 9e9d49af6d
commit 56144bc3aa

24
bot.go
View File

@ -938,6 +938,30 @@ func botUserConfig(m *ChatWarsMessage) {
} else {
out = fmt.Sprintf("%s Wartime : DEFEND GUILD (<a href=\"https://t.me/share/url?url=/config_def_castle\">set to castle</a>)\n", out)
}
if clt.Config.AutoDeposit {
out = fmt.Sprintf("%s Deposit : ON (<a href=\"https://t.me/share/url?url=/config_deposit_off\">set off</a>)\n", out)
if len(clt.Config.AutoDepositItems) == 0 {
out = fmt.Sprintf("%s <a href=\"https://t.me/share/url?url=/config_dep_add_item\">Add individual items</a>\n", out)
} else {
out = fmt.Sprintf("%s Individual items\n", out)
for _, v := range clt.Config.AutoDepositItems {
o, err := getObjItem(cacheObjItem[v])
logOnError(err, "botUserConfig : getObjItem")
out = fmt.Sprintf("%s %s(<a href=\"https://t.me/share/url?url=/config_dep_del_item %s\">remove</a>)\n", out, o.Names[0], o.Code)
}
}
if len(clt.Config.AutoDepositTypes) == 0 {
out = fmt.Sprintf("%s <a href=\"https://t.me/share/url?url=/config_dep_add_type\">Add item types</a>\n", out)
} else {
out = fmt.Sprintf("%s Item types\n", out)
for _, v := range clt.Config.AutoDepositItems {
out = fmt.Sprintf("%s %s(<a href=\"https://t.me/share/url?url=/config_dep_del_type %s\">remove</a>)\n", out, v, v)
}
}
} else {
out = fmt.Sprintf("%s Deposit : OFF (<a href=\"https://t.me/share/url?url=/config_deposit_on\">set on</a>)\n", out)
}
c := TGCommand{
Type: commandReplyMsg,
Text: out,