有没有其他方法可以在 FBInstant.updateAsync 中插入图像

问题描述

我在使用此代码时遇到问题

FBInstant.updateAsync({ 
  action: 'CUSTOM',template: 'play_turn',cta: 'Join',text: `Test user just played. Come join in game!`,image: imagebase64encoded,}) 

当我运行此代码时,我在控制台中收到错误消息“GraphQL 服务器响应错误 1675030:执行查询时出错。”当我尝试在没有图像的情况下运行它时,我在控制台中收到错误自定义更新需要图像或媒体输入”我的 imagebase64encoded 没有错误。有人遇到过这个问题吗?

解决方法

在你的 base64 字符串前面添加

@commands.Cog.listener()
async def on_reaction_add(self,reaction,user):
    if user.bot == False:
        print("Got Reaction")

使其成为 base64 图片。 所以它看起来像这样

"data:image/png;base64,"