fix(feishu): remove dead fetchBotOpenID stub and fix misleading comment
This commit is contained in:
parent
42eb6ea410
commit
595de7814d
1 changed files with 1 additions and 9 deletions
|
|
@ -58,8 +58,7 @@ func (c *FeishuChannel) Start(ctx context.Context) error {
|
||||||
return fmt.Errorf("feishu app_id or app_secret is empty")
|
return fmt.Errorf("feishu app_id or app_secret is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch bot info to get the bot's open_id for mention detection
|
// Bot open_id for @mention detection is populated lazily from the first mention event.
|
||||||
c.fetchBotOpenID(ctx)
|
|
||||||
|
|
||||||
dispatcher := larkdispatcher.NewEventDispatcher(c.feishuCfg.VerificationToken, c.feishuCfg.EncryptKey).
|
dispatcher := larkdispatcher.NewEventDispatcher(c.feishuCfg.VerificationToken, c.feishuCfg.EncryptKey).
|
||||||
OnP2MessageReceiveV1(c.handleMessageReceive)
|
OnP2MessageReceiveV1(c.handleMessageReceive)
|
||||||
|
|
@ -410,13 +409,6 @@ func (c *FeishuChannel) handleMessageReceive(ctx context.Context, event *larkim.
|
||||||
|
|
||||||
// --- Internal helpers ---
|
// --- Internal helpers ---
|
||||||
|
|
||||||
// fetchBotOpenID attempts to detect the bot's open_id.
|
|
||||||
// The Lark v3 SDK doesn't expose a direct GetBotInfo method,
|
|
||||||
// so the open_id is populated lazily from the first @_user_1 mention event.
|
|
||||||
func (c *FeishuChannel) fetchBotOpenID(_ context.Context) {
|
|
||||||
logger.DebugC("feishu", "Bot open_id will be detected from first @_user_1 mention event")
|
|
||||||
}
|
|
||||||
|
|
||||||
// isBotMentioned checks if the bot was @mentioned in the message.
|
// isBotMentioned checks if the bot was @mentioned in the message.
|
||||||
func (c *FeishuChannel) isBotMentioned(message *larkim.EventMessage) bool {
|
func (c *FeishuChannel) isBotMentioned(message *larkim.EventMessage) bool {
|
||||||
if message.Mentions == nil {
|
if message.Mentions == nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue