Is it possible to make a bot that opens the stage and starts performing?

Is it possible to immediately make the bot connect to the scene by ID and immediately open the scene with the specified name?
8 Replies
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Dmitry Batkovich
Dmitry BatkovichOP17mo ago
Even while I'm looking at the documentation, I only see that you can connect a bot as a listener, but how can you connect it to the stage as a speaker?
d.js docs
d.js docs17mo ago
method VoiceState#setSuppressed() Suppress/unsuppress the user. Only applicable for stage channels.
Dmitry Batkovich
Dmitry BatkovichOP17mo ago
thanks it remains now to understand how this works:
const { joinVoiceChannel } = require('@discordjs/voice');

const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
const { joinVoiceChannel } = require('@discordjs/voice');

const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});
as I understand it, connection is not needed here at all, just a joinChannel is launched and the bot comes in and then I change the voice state to it? well, I connected the bot as a listener, now I need him to open the stage and start performing at the input, I feed him an ffmpeg stream from an mp3 file, however, I look at the documentation and do not see the setSuspended(false) method in connection
function startingScene(sceneid,guildid,guild)
{
const connection = joinVoiceChannel
({
channelId: sceneid,
guildId: guildid,
adapterCreator: guild.voiceAdapterCreator,
});
console.log("Connection scene!");
connection.setSuppressed(false);
}
TypeError: connection.setSuppressed is not a function
function startingScene(sceneid,guildid,guild)
{
const connection = joinVoiceChannel
({
channelId: sceneid,
guildId: guildid,
adapterCreator: guild.voiceAdapterCreator,
});
console.log("Connection scene!");
connection.setSuppressed(false);
}
TypeError: connection.setSuppressed is not a function
does it come from somewhere else? done working now it remains only to figure out how to open a scene with a custom name its possible?
d.js docs
d.js docs17mo ago
method StageChannel#createStageInstance() Creates a stage instance associated with this stage channel.
Dmitry Batkovich
Dmitry BatkovichOP17mo ago
this thing will not rename the scene channel itself, but it will open the scene so that a green stripe appears on the top left on the server? is there any example of how to code it at all?
function startingScene(sceneid,guildid,guild)
{
const connection = joinVoiceChannel
({
channelId: sceneid,
guildId: guildid,
adapterCreator: guild.voiceAdapterCreator,
});

connection.on(VoiceConnectionStatus.Ready, () =>
{
console.log("Connection scene!");
guild.members.me.voice.setSuppressed(false);
});
}
function startingScene(sceneid,guildid,guild)
{
const connection = joinVoiceChannel
({
channelId: sceneid,
guildId: guildid,
adapterCreator: guild.voiceAdapterCreator,
});

connection.on(VoiceConnectionStatus.Ready, () =>
{
console.log("Connection scene!");
guild.members.me.voice.setSuppressed(false);
});
}
I tried to call it from connection it does not exist, the same if you call it directly from the scene from what it needs to be called?
const channel = guild.channels.cache.get(EVENTS_ID);

channel.createStageInstance();

TypeError: channel.createStageInstance is not a function
const channel = guild.channels.cache.get(EVENTS_ID);

channel.createStageInstance();

TypeError: channel.createStageInstance is not a function
a bot connects to this channel, but there is no createStageInstance method there ok ok I mixed up EVENTS_ID and SCENE_ID it worked thanks now options how do I create them? it's clear that everything is there, how do I make a test record?
const options = StageInstanceCreateOptions
{
topic: 'test',
StageInstancePrivacyLevel: public,
sendStartNotification: true,
};
const options = StageInstanceCreateOptions
{
topic: 'test',
StageInstancePrivacyLevel: public,
sendStartNotification: true,
};
no, how do I write it is there any example?
Youssef
Youssef17mo ago
huh it's a function, use it as a function .createStageInstance(options) is not a function? ah i see
Dmitry Batkovich
Dmitry BatkovichOP17mo ago
everything I've done is just json had to be created works thanks
Want results from more Discord servers?
Add your server