update delete
This commit is contained in:
8
bot.go
8
bot.go
@@ -121,8 +121,12 @@ func botDelete(m *tb.Message) {
|
||||
if m.Sender.ID == int(bot.Config.AdminID) {
|
||||
r := regexp.MustCompile("/delete (?P<CompanyID>[0-9]+)")
|
||||
ID64, _ := strconv.ParseInt(r.ReplaceAllString(m.Text, "${CompanyID}"), 10, 64)
|
||||
srv.DeleteCompany(uint8(ID64))
|
||||
bot.SendChat(m.Chat.ID, "Deleting")
|
||||
if _, ok := srv.Status.Companies[uint8(ID64)]; ok {
|
||||
srv.DeleteCompany(uint8(ID64))
|
||||
bot.SendChat(m.Chat.ID, "Deleting")
|
||||
} else {
|
||||
bot.SendChat(m.Chat.ID, "Company doesn't exist")
|
||||
}
|
||||
} else {
|
||||
bot.SendChat(m.Chat.ID, "Not authorized to delete")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user