【问题标题】:how to add option that will accept string discord js如何添加将接受字符串不和谐 js 的选项
【发布时间】:2022-11-01 18:50:12
【问题描述】:

我找不到我的问题的解决方案:

我想创建一个更改 nick 命令,但我不知道要使用哪种类型的选项

我的命令创建者

commands.create
            (
                {
                    name: 'change_nick',
                    description: 'changes nick for specified person',
                    options:
                    [
                        {
                            name: 'user',
                            description: 'user that name will be changed',
                            type: 6,
                        },
                        {
                            name: "new_username'
                            description: "new username",
                            type: "" //thath's what i'm searching for,
                        },
                    ]
                },
            );

我尝试浏览和阅读文档,但找不到任何东西

请帮助

【问题讨论】:

    标签: javascript node.js discord.js


    【解决方案1】:

    如果你想接受一个字符串,那么它是数字 3:

    commands.create({
      name: 'change_nick',
      description: 'changes nick for specified person',
      options: [
        {
          name: 'user',
          description: 'user that name will be changed',
          type: 6,
        },
        {
          name: 'new_username',
          description: 'new username',
          type: 3, //that's what I'm searching for,
        },
      ],
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-24
      • 2021-07-06
      • 1970-01-01
      • 1970-01-01
      • 2021-07-23
      • 2016-11-29
      • 2021-08-12
      • 1970-01-01
      相关资源
      最近更新 更多