Further development
Signed-off-by: Ettore Dreucci <ettore.dreucci@gmail.com>
This commit is contained in:
@@ -5,11 +5,14 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
adminInlineMenu [][]tb.InlineButton
|
||||
authInlineMenu [][]tb.InlineButton
|
||||
genericInlineMenu [][]tb.InlineButton
|
||||
startMenu [][]tb.InlineButton
|
||||
goBackMenu [][]tb.InlineButton
|
||||
superAdminInlineMenu [][]tb.InlineButton
|
||||
adminInlineMenu [][]tb.InlineButton
|
||||
authInlineMenu [][]tb.InlineButton
|
||||
genericInlineMenu [][]tb.InlineButton
|
||||
startMenu [][]tb.InlineButton
|
||||
myInfoMenu [][]tb.InlineButton
|
||||
botInfoMenu [][]tb.InlineButton
|
||||
authUserMenu [][]tb.InlineButton
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -27,24 +30,87 @@ var (
|
||||
}
|
||||
infoBtn = tb.InlineButton{
|
||||
Unique: "info_btn",
|
||||
Text: "\xE2\x84\xB9 Info",
|
||||
Text: "\xE2\x84\xB9 Bot info",
|
||||
}
|
||||
userBtn = tb.InlineButton{
|
||||
Unique: "user_btn",
|
||||
Text: "\xF0\x9F\x91\xA4 My info",
|
||||
}
|
||||
authBtn = tb.InlineButton{
|
||||
Unique: "auth_btn",
|
||||
Text: "\xE2\x9C\x85 Autorizza utente",
|
||||
}
|
||||
deAuthBtn = tb.InlineButton{
|
||||
Unique: "de_auth_btn",
|
||||
Text: "\xE2\x9D\x8C Deautorizza utente",
|
||||
}
|
||||
adminBtn = tb.InlineButton{
|
||||
Unique: "admin_btn",
|
||||
Text: "\xF0\x9F\x91\x91 Nomina amministratore",
|
||||
}
|
||||
deAdminBtn = tb.InlineButton{
|
||||
Unique: "de_admin_btn",
|
||||
Text: "\xF0\x9F\x92\x80 Rimuovi amministratore",
|
||||
}
|
||||
sendMsgBtn = tb.InlineButton{
|
||||
Unique: "send_msg_btn",
|
||||
Text: "\xF0\x9F\x93\xA3 Invia messaggio alla sezione",
|
||||
}
|
||||
authUGSopranoBtn = tb.InlineButton{
|
||||
Unique: "auth_ugSoprano_btn",
|
||||
Text: "\xF0\x9F\x91\xA7 Soprani",
|
||||
}
|
||||
authUGContraltoBtn = tb.InlineButton{
|
||||
Unique: "auth_ugContralto_btn",
|
||||
Text: "\xF0\x9F\x91\xA9 Contralti",
|
||||
}
|
||||
authUGTenoreBtn = tb.InlineButton{
|
||||
Unique: "auth_ugTenore_btn",
|
||||
Text: "\xF0\x9F\x91\xA6 Tenori",
|
||||
}
|
||||
authUGBassoBtn = tb.InlineButton{
|
||||
Unique: "auth_ugBasso_btn",
|
||||
Text: "\xF0\x9F\x91\xA8 Bassi",
|
||||
}
|
||||
authUGCommissarioBtn = tb.InlineButton{
|
||||
Unique: "auth_ugCommissario_btn",
|
||||
Text: "\xF0\x9F\x93\x9D Commissari",
|
||||
}
|
||||
authUGReferenteBtn = tb.InlineButton{
|
||||
Unique: "auth_ugReferente_btn",
|
||||
Text: "\xF0\x9F\x93\x8B Referenti",
|
||||
}
|
||||
authUGPreparatoreBtn = tb.InlineButton{
|
||||
Unique: "auth_ugPreparatori_btn",
|
||||
Text: "\xF0\x9F\x8E\xB9 Preparatori",
|
||||
}
|
||||
)
|
||||
|
||||
func setBotMenus() error {
|
||||
|
||||
genericInlineMenu = append(genericInlineMenu, []tb.InlineButton{userBtn, infoBtn}, []tb.InlineButton{stopBtn})
|
||||
genericInlineMenu = append(genericInlineMenu, []tb.InlineButton{userBtn, infoBtn})
|
||||
|
||||
authInlineMenu = genericInlineMenu
|
||||
adminInlineMenu = genericInlineMenu
|
||||
//adminInlineMenu = append(adminInlineMenu, []tb.InlineButton{stopBtn, infoBtn})
|
||||
//authInlineMenu = append(authInlineMenu, []tb.InlineButton{stopBtn, infoBtn})
|
||||
//authInlineMenu = append(authInlineMenu, []tb.InlineButton{, })
|
||||
|
||||
adminInlineMenu = authInlineMenu
|
||||
adminInlineMenu = append(adminInlineMenu,
|
||||
[]tb.InlineButton{authBtn, deAuthBtn},
|
||||
[]tb.InlineButton{sendMsgBtn},
|
||||
)
|
||||
|
||||
superAdminInlineMenu = adminInlineMenu
|
||||
superAdminInlineMenu = append(superAdminInlineMenu, []tb.InlineButton{adminBtn, deAdminBtn})
|
||||
|
||||
startMenu = append(startMenu, []tb.InlineButton{startBtn})
|
||||
goBackMenu = append(goBackMenu, []tb.InlineButton{backBtn})
|
||||
myInfoMenu = append(myInfoMenu, []tb.InlineButton{backBtn})
|
||||
botInfoMenu = append(botInfoMenu, []tb.InlineButton{stopBtn}, []tb.InlineButton{backBtn})
|
||||
authUserMenu = append(authUserMenu,
|
||||
[]tb.InlineButton{authUGSopranoBtn, authUGContraltoBtn},
|
||||
[]tb.InlineButton{authUGTenoreBtn, authUGBassoBtn},
|
||||
[]tb.InlineButton{authUGCommissarioBtn, authUGReferenteBtn, authUGPreparatoreBtn},
|
||||
[]tb.InlineButton{backBtn},
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -56,7 +122,7 @@ func setBotCallbacks() error {
|
||||
|
||||
bot.Handle(&startBtn, func(c *tb.Callback) {
|
||||
bot.Respond(c, &tb.CallbackResponse{})
|
||||
startCmd(c.Sender)
|
||||
startCmd(c.Sender, false)
|
||||
})
|
||||
|
||||
bot.Handle(&stopBtn, func(c *tb.Callback) {
|
||||
@@ -66,15 +132,30 @@ func setBotCallbacks() error {
|
||||
|
||||
bot.Handle(&userBtn, func(c *tb.Callback) {
|
||||
bot.Respond(c, &tb.CallbackResponse{})
|
||||
userInfoCmd(c.Sender)
|
||||
msg, _ := getUserDescription(c.Sender)
|
||||
sendMsgWithSpecificMenu(c.Sender, msg, myInfoMenu, false)
|
||||
})
|
||||
bot.Handle(&infoBtn, func(c *tb.Callback) {
|
||||
bot.Respond(c, &tb.CallbackResponse{})
|
||||
sendMsgWithSpecificMenu(c.Sender, contactMsg, goBackMenu)
|
||||
sendMsgWithSpecificMenu(c.Sender, contactMsg, botInfoMenu, false)
|
||||
})
|
||||
bot.Handle(&backBtn, func(c *tb.Callback) {
|
||||
bot.Respond(c, &tb.CallbackResponse{})
|
||||
sendMsgWithMenu(c.Sender, menuMsg)
|
||||
sendMsgWithMenu(c.Sender, menuMsg, false)
|
||||
})
|
||||
|
||||
bot.Handle(&authBtn, func(c *tb.Callback) {
|
||||
bot.Respond(c, &tb.CallbackResponse{})
|
||||
sendMsgWithMenu(c.Sender, authHowToMsg, false)
|
||||
|
||||
})
|
||||
bot.Handle(&deAuthBtn, func(c *tb.Callback) {
|
||||
bot.Respond(c, &tb.CallbackResponse{})
|
||||
|
||||
})
|
||||
bot.Handle(&sendMsgBtn, func(c *tb.Callback) {
|
||||
bot.Respond(c, &tb.CallbackResponse{})
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user