diff --git a/bot.go b/bot.go
index 9fd5470..6483118 100644
--- a/bot.go
+++ b/bot.go
@@ -923,6 +923,11 @@ func botUserConfig(m *ChatWarsMessage) {
} else {
out = fmt.Sprintf("%s Pillage : OFF (set on)\n", out)
}
+ if clt.Config.Wartime == `🛡Defend` {
+ out = fmt.Sprintf("%s Wartime : DEFEND CASTLE (set to guild)\n", out)
+ } else {
+ out = fmt.Sprintf("%s Wartime : DEFEND GUILD (set to castle)\n", out)
+ }
c := TGCommand{
Type: commandReplyMsg,
Text: out,
diff --git a/client.go b/client.go
index 86d2d6c..41a9839 100644
--- a/client.go
+++ b/client.go
@@ -35,6 +35,14 @@ func loadClients() error {
if cx.Config == nil {
cx.Config = &ChirpConfig{
InterceptPillage: true,
+ Wartime: `🛡Defend`,
+ }
+ } else {
+ if cx.Config.InterceptPillage == nil {
+ cx.Config.InterceptPillage = true
+ }
+ if cx.Config.Wartime == nil {
+ cx.Config.Wartime = `🛡Defend`
}
}
/*
diff --git a/def.go b/def.go
index de1c1c2..bd5778c 100644
--- a/def.go
+++ b/def.go
@@ -103,6 +103,7 @@ type ChirpConfig struct {
AutoDeposit bool `json:"auto_deposit"`
AutoDepositItems []string `json:"auto_deposit_items"`
AutoDepositTypes []string `json:"auto_deposit_types"`
+ Wartime string `json:"wartime"`
}
type ChirpClient struct {
diff --git a/job.go b/job.go
index 0a32dc1..257e6f9 100644
--- a/job.go
+++ b/job.go
@@ -1868,7 +1868,9 @@ func jobSetDef(j Job) {
cwm, err := parseSubTypeMessageMeAck(msg, rule.re)
if cwm.State == `🛌Rest` {
- clientSendCWMsg(j.UserID64, `🛡Defend`)
+ clt, err := getLockedClient(j.UserID64, false)
+ clt.Mux.Unlock()
+ clientSendCWMsg(j.UserID64, clt.Config.Wartime)
}
err = setJobDone(j.ID64)