func (s *Stake) water(args []string, from *tg.User) string { if s.state != ignited { return s.stateDesc() } s.state = idle return fmt.Sprintf("%s 英勇地解救了 %s。", from.DisplayName(), s.peopleStr) }
func (s *Stake) add(things []string, from *tg.User) string { if s.state != installed && s.state != ignited { return s.stateDesc() } if len(things) == 0 { return "请至少指定一种调料 - -b" } return fmt.Sprintf("%s 往火刑柱上加了 %s。", from.DisplayName(), makeString(things)) }
func (s *Stake) install(people []string, from *tg.User) string { if s.state != idle { return s.stateDesc() } if len(people) == 0 { return "至少要绑一个人。" } for i, p := range people { people[i] = strings.TrimLeft(p, "@") } s.people = people s.peopleStr = makeString(people) s.state = installed return fmt.Sprintf("%s 把 %s 绑到了火刑柱上。", from.DisplayName(), s.peopleStr) }