forked from carrydela/mygoTgChanBot
修复动态管理员自动识别转发消息
This commit is contained in:
@@ -116,7 +116,7 @@ func (b *Bot) handleTextInput(c tele.Context) error {
|
|||||||
state := b.states.Get(c.Sender().ID)
|
state := b.states.Get(c.Sender().ID)
|
||||||
|
|
||||||
// 私聊收到转发消息,直接启动投稿流程(无需先 /post)
|
// 私聊收到转发消息,直接启动投稿流程(无需先 /post)
|
||||||
if isForwarded && b.cfg.IsAdmin(c.Sender().ID) {
|
if isForwarded && b.isAdmin(c.Sender().ID) {
|
||||||
if state == nil {
|
if state == nil {
|
||||||
b.states.StartPost(c.Sender().ID)
|
b.states.StartPost(c.Sender().ID)
|
||||||
}
|
}
|
||||||
@@ -138,7 +138,7 @@ func (b *Bot) handleTextInput(c tele.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bot) handleForwarded(c tele.Context) error {
|
func (b *Bot) handleForwarded(c tele.Context) error {
|
||||||
if !b.cfg.IsAdmin(c.Sender().ID) {
|
if !b.isAdmin(c.Sender().ID) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ func (b *Bot) buildCategoryKeyboard(categories []storage.Category) *tele.ReplyMa
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bot) handleCallback(c tele.Context) error {
|
func (b *Bot) handleCallback(c tele.Context) error {
|
||||||
if !b.cfg.IsAdmin(c.Sender().ID) {
|
if !b.isAdmin(c.Sender().ID) {
|
||||||
return c.Respond(&tele.CallbackResponse{Text: "无权限"})
|
return c.Respond(&tele.CallbackResponse{Text: "无权限"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user