最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

discord.js - Possible To Launch A Discord Activity From Embed Button Or Slash Command? - Stack Overflow

programmeradmin4浏览0评论

I have a Discord bot written in DiscordJS installed on some servers. I added an Activity to it (a mini-game). In all the docs I see and in testing I am able to launch my activity by clicking the little Activity Launch icon which opens up a new screen showing my app activities plus promoted and featured activities from other developers.

Instead of my users having to click this icon then launch the activity is it possible to code an embed button or a slash command response from my bot code that will launch the activity directly? Or which will generate a new embed with a new button in the text channel to launch the activity.

Basically, can I launch an activity without going through the Activity Launcher step?

I have a Discord bot written in DiscordJS installed on some servers. I added an Activity to it (a mini-game). In all the docs I see and in testing I am able to launch my activity by clicking the little Activity Launch icon which opens up a new screen showing my app activities plus promoted and featured activities from other developers.

Instead of my users having to click this icon then launch the activity is it possible to code an embed button or a slash command response from my bot code that will launch the activity directly? Or which will generate a new embed with a new button in the text channel to launch the activity.

Basically, can I launch an activity without going through the Activity Launcher step?

Share Improve this question edited Mar 22 at 15:51 Neil Collier asked Mar 21 at 15:52 Neil CollierNeil Collier 112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can create an invite to a voice channel with a targetApplication, like so:

voiceChannel.createInvite({
    targetType: InviteTargetType.EmbeddedApplication,
    targetApplication: yourActivity,
});

https://discord.js./docs/packages/discord.js/14.18.0/InviteCreateOptions:Interface

You can then send the invite link which renders as a banner with your activity's name and a big green "Start" button.

发布评论

评论列表(0)

  1. 暂无评论