#Need a solution for this if possible. About lavasnek_rs

1 messages · Page 1 of 1 (latest)

sacred viper
#

lavasnek_rs connects to the respective server, Searches the play query, and responds "Playing {query} but, I can't really hear anything. Like does everything but doesn't play anything.

@lavalinkmusic.command()
@lightbulb.add_checks(lightbulb.guild_only)
@lightbulb.option("query", "The query to search for.", modifier=lightbulb.OptionModifier.CONSUME_REST, required=True)
@lightbulb.command("play", "Searches the query on youtube, or adds the URL to the queue.")
@lightbulb.implements(lightbulb.PrefixCommand, lightbulb.SlashCommand)
async def play(ctx: lightbulb.Context) -> None:
query = ctx.options.query
con = lavalinkmusic.bot.d.lavalink.get_guild_gateway_connection_info(ctx.guild_id)
if not con:
await _join(ctx)

query_information = await lavalinkmusic.bot.d.lavalink.auto_search_tracks(query)

if not query_information.tracks:
    await ctx.respond("Could not find any video of the search query.")
    return

try:
    await lavalinkmusic.bot.d.lavalink.play(ctx.guild_id, query_information.tracks[0]).requester(ctx.author.id).queue()

except lavasnek_rs.NoSessionPresent:
    await ctx.respond("Use `/join` first")
    return

await ctx.respond(f"Added to queue: {query_information.tracks[0].info.title}")

This is basically the code. It does it job but doesn't play anything. Just responds...

#
@lavalinkmusic.command()
@lightbulb.add_checks(lightbulb.guild_only)
@lightbulb.option("query", "The query to search for.", modifier=lightbulb.OptionModifier.CONSUME_REST, required=True)
@lightbulb.command("play", "Searches the query on youtube, or adds the URL to the queue.")
@lightbulb.implements(lightbulb.PrefixCommand, lightbulb.SlashCommand)
async def play(ctx: lightbulb.Context) -> None:
    query = ctx.options.query
    con = lavalinkmusic.bot.d.lavalink.get_guild_gateway_connection_info(ctx.guild_id)
    if not con:
        await _join(ctx)

    query_information = await lavalinkmusic.bot.d.lavalink.auto_search_tracks(query)

    if not query_information.tracks:
        await ctx.respond("Could not find any video of the search query.")
        return

    try:
        await lavalinkmusic.bot.d.lavalink.play(ctx.guild_id, query_information.tracks[0]).requester(ctx.author.id).queue()

    except lavasnek_rs.NoSessionPresent:
        await ctx.respond("Use /join first")
        return

    await ctx.respond(f"Added to queue: {query_information.tracks[0].info.title}")```
tawny nexus
#

Check the pins in #lavalink_rs, there should be more info there iirc

sacred viper
#

catThink unfortunately this doesn't help