【问题标题】:Is it possible to add Google Picker to a Discord Button?是否可以将 Google Picker 添加到 Discord 按钮?
【发布时间】:2022-01-25 22:46:36
【问题描述】:

我一直在尝试使用 Discord.js 和 Google Picker API 创建一个 Discord 机器人。我想知道是否有一种方法可以单击 Discord 中的按钮直接打开 Google Picker。

单击此按钮将打开选择器:

【问题讨论】:

  • 您可以重定向到按钮样式LINK的链接。
  • @Leau 我对 JS 很陌生,你熟悉如何去做吗
  • 你有重定向到的链接吗?
  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: javascript discord discord.js google-picker


【解决方案1】:

试试这个 guide 的 Discord 按钮

我给你一个例子,说明如何使用它所指的按钮

const { MessageActionRow, MessageButton } = require('discord.js');

//add your code here, and the example as an embed and response message
        const row = new MessageActionRow()
    .addComponents(
        new MessageButton()
        .setURL('your.url.here')
            .setLabel('Google Picker')
            .setStyle('LINK') )
            message.reply({
                content: 'Google Picker?',
                components: [row] //if you want to add more buttons, it would be like this: components: [row, row1, row2, row...]
            })

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-22
    相关资源
    最近更新 更多