mirror of
https://git.klmp200.net/ALFRED/ALFRED.git
synced 2025-01-18 10:36:44 +01:00
Fix register_private.go permission error
This commit is contained in:
parent
21ae38639d
commit
94313b4819
@ -2,7 +2,7 @@
|
||||
* @Author: Bartuccio Antoine
|
||||
* @Date: 2019-01-02 22:46:05
|
||||
* @Last Modified by: Bartuccio Antoine
|
||||
* @Last Modified time: 2019-01-03 00:02:48
|
||||
* @Last Modified time: 2019-01-03 22:00:09
|
||||
*/
|
||||
|
||||
package commands
|
||||
@ -17,10 +17,12 @@ func RegisterPrivate(m *tb.Message) {
|
||||
|
||||
if m.Chat.Type != tb.ChatPrivate {
|
||||
shared.Bot.Send(m.Chat, "Cette commande n'est disponible qu'en messages privés")
|
||||
return
|
||||
}
|
||||
|
||||
if m.Sender.Username == "" {
|
||||
shared.Bot.Send(m.Chat, "Vous devez avoir enregistré un username")
|
||||
return
|
||||
}
|
||||
|
||||
shared.Users.SetUserChat(m.Sender.Username, m.Chat)
|
||||
@ -32,10 +34,12 @@ func UnRegisterPrivate(m *tb.Message) {
|
||||
|
||||
if m.Chat.Type != tb.ChatPrivate {
|
||||
shared.Bot.Send(m.Chat, "Cette commande n'est disponible qu'en messages privés")
|
||||
return
|
||||
}
|
||||
|
||||
if m.Sender.Username == "" {
|
||||
shared.Bot.Send(m.Chat, "Vous devez avoir enregistré un username")
|
||||
return
|
||||
}
|
||||
|
||||
shared.Users.SetUserChat(m.Sender.Username, nil)
|
||||
|
Loading…
Reference in New Issue
Block a user