test g roles

This commit is contained in:
shoopea 2019-08-12 16:42:18 +08:00
parent 3048f967d5
commit eace24d67f

8
msg.go
View File

@ -117,22 +117,22 @@ func parseSubTypeMessageGRolesAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
SquireID64: getObjUserID(r.ReplaceAllString(m.Text, "${Squire}")),
TreasurerID64: getObjUserID(r.ReplaceAllString(m.Text, "${Treasurer}")),
*/
if strings.Compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Bartender}")) != 0 {
if len(r.ReplaceAllString(m.Text, "${Bartender}")) > 0 {
cwm.BartenderID64 = getObjUserID(r.ReplaceAllString(m.Text, "${Bartender}"))
} else {
cwm.BartenderID64 = 0
}
if strings.Compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Commander}")) != 0 {
if len(r.ReplaceAllString(m.Text, "${Commander}")) > 0 {
cwm.CommanderID64 = getObjUserID(r.ReplaceAllString(m.Text, "${Commander}"))
} else {
cwm.CommanderID64 = 0
}
if strings.Compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Squire}")) != 0 {
if len(r.ReplaceAllString(m.Text, "${Squire}")) > 0 {
cwm.SquireID64 = getObjUserID(r.ReplaceAllString(m.Text, "${Squire}"))
} else {
cwm.SquireID64 = 0
}
if strings.Compare(`[unassigned]`, r.ReplaceAllString(m.Text, "${Treasurer}")) != 0 {
if len(r.ReplaceAllString(m.Text, "${Treasurer}")) > 0 {
cwm.TreasurerID64 = getObjUserID(r.ReplaceAllString(m.Text, "${Treasurer}"))
} else {
cwm.TreasurerID64 = 0