commands/imagepack: use double puppet for fetching matrix packs

This commit is contained in:
Tulir Asokan
2026-03-30 17:41:22 +03:00
parent a0323a5233
commit 358318c734
3 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -81,9 +81,14 @@ func (t *TelegramClient) fnUploadEmojiPack(ce *commands.Event) {
ce.Reply("Usage: `$cmdprefix emoji-pack upload <telegram shortcode> <room ID> <state key>`")
return
}
mx, ok := t.main.Bridge.Matrix.(bridgev2.MatrixConnectorWithArbitraryRoomState)
dbl := ce.User.DoublePuppet(ce.Ctx)
if dbl == nil {
ce.Reply("Double puppeting is required to fetch emoji packs from Matrix")
return
}
mx, ok := dbl.(bridgev2.MatrixAPIWithArbitraryRoomState)
if !ok {
ce.Reply("Matrix connector does not support fetching room state")
ce.Reply("Matrix connector does not implement required interface")
return
}
tgPackShortcode := ce.Args[0]