
Recherche avancée
Autres articles (60)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (5540)
-
Anomalie #2868 (Fermé) : Calcul #URL_RUBRIQUE dans boucle pour
27 septembre 2012, par yffic CloarecCa se passe dans spip 2.1, dernière version svn avec Bonux 2 à jour svn aussi... Donc je ne sais pas si ça sera corrigé. Le problème n’apparait pas en spip 3 Donc sur un spip 2.1 tout neuf avec uniquement Bonux 2, le calcul de #URL_RUBRIQUEid_rub rajoute &connect=pour en fin d’url : (...)
-
Merge commit ’136c3438bbdb56a5d2f1f0f486f180641dc6dda0’
21 avril 2016, par Derek BuitenhuisMerge commit ’136c3438bbdb56a5d2f1f0f486f180641dc6dda0’
This commit is a no-op.
* commit ’136c3438bbdb56a5d2f1f0f486f180641dc6dda0’ :
tcp : Use rw_timeout for setting the connect/listen timeoutsMerged-by : Derek Buitenhuis <derek.buitenhuis@gmail.com>
-
Discord.py bot joins voice channel but when using voicechannel.play i get error:Command raised an exception : ClientException : Not connected to voice
25 mai 2023, par AudibleDruidSo i've managed to get my discord bot to join a voice channel but when i use the play command it gives me an error that its not conencted to voice
Command raised an exception: ClientException: Not connected to voice.


Here is my code :


import discord
import random
import glob
from discord.ext import commands

##discord intents 
intents = discord.Intents()
intents.members = True
intents.messages = True
intents.guilds = True
intents.voice_states = True



connect the bot to a voice channel :



##called when user wants bot to join voice channel
@bot.command(name ='join', help = 'Make the bot join a voice channel')
async def join(context):
 
 botVoice = context.message.guild.voice_client
 if context.guild.voice_client:
 botvoicechannel = context.message.guild.voice_client.channel
 else:
 botvoicechannel = None
 authorVoice = context.author.voice
 if context.author.voice:
 authorvoicechannel = context.author.voice.channel
 else:
 authorvoicechannel = None
 
 ##await context.reply('bot voice channel: {}\n\nbot voice:\n{}\n\nauthor voice channel: {}\n\nauthor voice voice:\n{}\n\n'.format(botvoicechannel, botVoice, authorvoicechannel, authorVoice))
 
 if not authorVoice and not botVoice:
 await context.reply('Connect to a voice channel first.')
 return
 elif authorVoice and not botVoice:
 await context.reply('Connecting to {}'.format(authorvoicechannel))
 await authorvoicechannel.connect()
 return
 elif not authorVoice and botVoice:
 await context.reply("You aren't in a channel, I'm in {}".format(botvoicechannel))
 return
 elif authorVoice and botVoice:
 if (botvoicechannel == authorvoicechannel):
 await context.reply("I'm already in here.")
 return
 else:
 await context.reply('Moving to you!')
 await botVoice.move_to(authorvoicechannel)
 return
 return



and have it play a url :


@bot.command(name ='play', help = 'Make the bot play a url')
async def play(context, url):
 botVoice = context.message.guild.voice_client
 audioSource = discord.FFmpegPCMAudio(url, executable="ffmpeg")
 botVoice.play(audioSource, after = None)



the code works and the bot joins the voice channel. i see it in the voice channel with me, however i get an error when it gets to
botVoice.play(audioSource, after = None)


the error message is :

error: Command raised an exception: ClientException: Not connected to voice.


i changed
botVoice = context.message.guild.voice_client
frombotVoice = context.guild.voice_client
but that didnt seem to change anything. not sure what to try next. It seems like it wants to play the url the bot just doesnt realize its in the voice channel with me.

maybe a related error. if i kill my python script the bot remains in the channel even though its not running. then when i start it up and do the !join command it says its joining even though its already in the channel with me. its weird because on the join command it checks to see if its already in a voice channel so it should know that its in there with me. idk what to try next. thanks for any suggestions. i only posted relevant code. let me know if you think im missing something else.


thanks for the help