Skip to content

How can i send a audio file as voice message? #675

Answered by aiko-chan-ai
lonelil asked this question in Q&A
Discussion options

You must be logged in to vote
		const channel = client.channels.cache.get('cid');
		const attachment = new Discord.MessageAttachment(
			'./test.mp3', // path file
			'test.ogg', // must be .ogg
			{
				waveform: '=',
				duration_secs: 1, // any number you want
			},
		);
		channel.send({
			files: [attachment],
			flags: 'IS_VOICE_MESSAGE',
		});

you can use it in the next updated version

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lonelil
Comment options

@aiko-chan-ai
Comment options

@lonelil
Comment options

Answer selected by lonelil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants