It's that time again
It's that time where I need to make another discord bot, where can I look to get started with voice?
52 Replies
Oh nevermind, it seems discord bots cannot actually listen to audio...
they can
in the gradle plugin, you can do
kordEx { bot { voice = true } }
if you're not using the gradle plugin, you already have the dependencies you need for voice
you'll need to use Kord's APIs for voice
they have no docs for it other than "use lavaplayer/lavalink for a music bot"Oh shit nice
so you're going to have to do some messing around
My friend lying to me
yeah no they absolutely can
Craig
The multi-track recording bot for Discord.
I used this for ages
it's definitely a thing
Yeah I just tried this out too
Good to know
How do I get the Kord channel ?
So I can connect to it?
val channel = member?.getVoiceState()?.getChannelOrNull() ?: return@action
you get it like you get any other channel
generally from the guild object
though for a specific member you use the voice state yeah
But I can't call
connect
on that result
like the example
omg pls remove slow mode in forum channels its driving me crazy alreadydid you reload your dependencies when you updated your plugin config?
I didn't update the config I wasn't sure where to put that string
are you using the kordex gradle plugin?
No(t yet)
ah, then you should already depend on the kord voice module
honestly I haven't used the voice API so I'm not really sure what you need
@SchlaubiBus would know
They can, it's just not officially supported
I added
And still can't connect
you don't need a Kord dependency
and you almost certainly shouldn't add one
What's your code
KordEx provides the version it needs
Is this not you saying to add it?
no, that's me saying you already depend on it
I'm not using the plugin
which is why you're already depending on it
yeah
Why can't I call connect then?
BaseVoiceChannelBehavior
doesn't have any functions on itmaybe you need to cast it using the
of
or ofOrNull
functions?
I dunnoah you're on kordex 2.2 or earlier as well
that's fine tho
It's an extension that needs to be imported https://github.com/kordlib/kord/blob/main/core-voice/src/main/kotlin/BaseVoiceChannelBehaviorExtensions.kt
GitHub
kord/core-voice/src/main/kotlin/BaseVoiceChannelBehaviorExtensions....
Idiomatic Kotlin Wrapper for The Discord API. Contribute to kordlib/kord development by creating an account on GitHub.
Its kinda hard to give more help on the limited info
I don't have that class on my cp
I don't have voice-core
you depend on kordex, so remove both kord deps and then reload deps in the sidebar
otherwise you're gonna have weird stuff happen
I have
hmm
which version of kordex is this?
1.9.0-SNAPSHOT
out of date by a fair bit but that does include a core-voice dependency
Am I missing something?
no that seems fine for that version
it looks like that extension function has been around for at least a year
I've really broken it now
Cannot access class 'dev. kord. core. behavior. MemberBehavior'. Check your module classpath for missing or conflicting dependencies
reload gradle normally again
IJ brr
OK,
1.9.0-SNAPSHOT
was released on july 1st 2024 and that kord extension..
april 5th 2023
yeah it should be there
you could check the dependencies
gradle task, the dep should be there
I need to get ready to go out but yeah everything should be present > Could not find dev.kord:kord-core-voice:0.15.0-SNAPSHOT.
Ah yeah that's right
That is not in my build gradle lol
Sonatype killed the dependency
I forgot
Try adding repo.kord.dev/snapshots to your repos
Like this?
Well with the https://
Oh yeah
I'm on mobile
Na I shoulda assumed that haha
Put it as the last repo
So you're not slamming it for your other deps
Okay so does anyone know how I can listen for audio
I can play audio okay
Oh I found the incoming audio frames flow
Doesn't seem to collect anything...
I think there might be a bug
Because connection.streams.ssrcToUser and incomingUserStreams don't work
Well it's only set if I leave and rejoin the channel