Recherche avancée

Médias (0)

Mot : - Tags -/configuration

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (91)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (13844)

  • avfilter/af_channelmap : add some additional checks for the mappings

    18 mars 2024, par Marton Balint
    avfilter/af_channelmap : add some additional checks for the mappings
    

    - Properly initialize all the mappings to -1 by default.
    - Make sure every output channel is assigned exactly once
    - Autodetect a native layout when only native channels are present
    - Always honor the user specified layout, but make sure the mapping is
    compatible with it

    The last item is a regression from 4af412be7153405e43930ac73fc7d91d7ded19eb.

    Signed-off-by : Marton Balint <cus@passwd.hu>

    • [DH] libavfilter/af_channelmap.c
  • Discord music bot won't join Voice channel

    16 mars 2024, par Skely

    I followed a tutorial for creating a music bot in discord, but it will not join my vc no matter what. Every command works and it gives the correct responses and songs is in the queue. The bot have every permission know to man, but it still won't join. Any way to fix this issue ?&#xA;Thanks in advance !!

    &#xA;

    This is my code and files

    &#xA;

    main.py

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;import os&#xA;import asyncio&#xA;&#xA;from help_cog import help_cog&#xA;from music_cog import music_cog&#xA;&#xA;bot = commands.Bot(&#xA;    command_prefix="?", &#xA;    intents=discord.Intents.all(),&#xA;    help_command=None&#xA;)&#xA;&#xA;async def main():&#xA;    async with bot:&#xA;        await bot.add_cog(help_cog(bot))&#xA;        await bot.add_cog(music_cog(bot))&#xA;        await bot.start(os.getenv("TOKEN"))&#xA;&#xA;asyncio.run(main())&#xA;

    &#xA;

    music_cog.py

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;&#xA;from yt_dlp import YoutubeDL&#xA;&#xA;import yt_dlp as youtube_dl&#xA;&#xA;class music_cog(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;&#xA;        self.is_playing = False&#xA;        self.is_paused = False&#xA;&#xA;        self.music_queue = []&#xA;        self.YDL_OPTIONS = {"format": "bestaudio", "postprocessors": [{"key": "FFmpegExtractAudio", "preferredcodec": "mp3", "preferredquality": "192",}]}&#xA;        self.FFMPEG_OPTIONS = {"before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5", "options": "-vn"}&#xA;&#xA;        self.vc = None&#xA;        print("Success")&#xA;&#xA;    def search_yt(self, item):&#xA;        with YoutubeDL(self.YDL_OPTIONS) as ydl:&#xA;            try:&#xA;                info = ydl.extract_info(f"ytsearch:{item}", download=False)["entries"][0]&#xA;            except Exception:&#xA;                return False&#xA;        return {"source": info["url"], "title": info["title"]}&#xA;&#xA;    def play_next(self):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;&#xA;            m_url = self.music_queue[0][0]["source"]&#xA;&#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    async def play_music(self, ctx):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;            m_url = self.music_queue[0][0]["source"]&#xA;&#xA;            if self.vc == None or not self.vc.is_connected():&#xA;                self.vc = await self.music_queue[0][1].connect()&#xA;&#xA;                if self.vc == None:&#xA;                    await ctx.send("Could not connect to the voice channel")&#xA;                    return&#xA;            else:&#xA;                await self.vc.move_to(self.music_queue[0][1])&#xA;            &#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    @commands.command(name="play", aliases=["p", "playing"], help="Play the selected song from YouTube")&#xA;    async def play(self, ctx, *args):&#xA;        query = " ".join(args)&#xA;&#xA;        voice_channel = ctx.author.voice.channel&#xA;        if voice_channel is None:&#xA;            await ctx.send("Connect to a voice channel!")&#xA;        elif self.is_paused:&#xA;            self.vc.resume()&#xA;        else:&#xA;            song = self.search_yt(query)&#xA;            if type(song) == type(True):&#xA;                await ctx.send("Could not download the song. Incorrect format, try a different keyword")&#xA;            else:&#xA;                await ctx.send("Song added to queue")&#xA;                self.music_queue.append([song, voice_channel])&#xA;&#xA;                if self.is_playing == False:&#xA;                    await self.play_music(ctx)&#xA;    &#xA;    @commands.command(name="pause", help="Pauses the current song being played")&#xA;    async def pause(self, ctx, *args):&#xA;        if self.is_playing:&#xA;            self.is_playing = False&#xA;            self.is_paused = True&#xA;            self.vc.pause()&#xA;        elif self.is_paused:&#xA;            self.is_playing = True&#xA;            self.is_paused = False&#xA;            self.vc.resume()&#xA;&#xA;    @commands.command(name="resume", aliases=["r"], help="Resumes playing the current song")&#xA;    async def resume(self, ctx, *args):&#xA;        if self.is_paused:&#xA;            self.is_playing = True&#xA;            self.is_paused = False&#xA;            self.vc.resume()&#xA;        &#xA;    @commands.command(name="skip", aliases=["s"], help="Skips the currently played song")&#xA;    async def skip(self, ctx, *args):&#xA;        if self.vc != None and self.vc:&#xA;            self.vc.stop()&#xA;            await self.play_music(ctx)&#xA;&#xA;    @commands.command(name="queue", aliases=["q"], help="Displays all the songs currently in queue")&#xA;    async def queue(self, ctx):&#xA;        retval = ""&#xA;&#xA;        for i in range(0, len(self.music_queue)):&#xA;            if i > 4: break&#xA;            retval &#x2B;= self.music_queue[i][0]["title"] &#x2B; "\n"&#xA;&#xA;        if retval != "":&#xA;            await ctx.send(retval)&#xA;        else:&#xA;            await ctx.send("No music in the current queue")&#xA;    &#xA;    @commands.command(name="clear", aliases=["c", "bin"], help="Stops the current song and clears the queue")&#xA;    async def clear(self, ctx, *args):&#xA;        if self.vc != None and self.is_playing:&#xA;            self.vc.stop()&#xA;        self.music_queue = []&#xA;        await ctx.send("Music queue cleared")&#xA;&#xA;    @commands.command(name="leave", aliases=["disconnect", "l", "d"], help="Kick the bot from the voice channel")&#xA;    async def leave(self, ctx):&#xA;        self.is_playing = False&#xA;        self.is_paused = False&#xA;        await self.vc.disconnect()&#xA;

    &#xA;

    help_cog.py

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;&#xA;class help_cog(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;&#xA;        self.help_message = """&#xA;        Help message&#xA;"""&#xA;&#xA;        self.text_channel_text = []&#xA;    &#xA;    @commands.Cog.listener()&#xA;    async def on_ready(self):&#xA;        for guild in self.bot.guilds:&#xA;            for channel in guild.text_channels:&#xA;                self.text_channel_text.append(channel)&#xA;&#xA;        await self.send_to_all(self.help_message)&#xA;&#xA;    async def send_to_all(self, msg):&#xA;        for text_channel in self.text_channel_text:&#xA;            await text_channel.send(msg)&#xA;        &#xA;    @commands.command(name="help", help="Displays all the available commands")&#xA;    async def help(self, ctx):&#xA;        await ctx.send(self.help_message)&#xA;

    &#xA;

  • Error for command not found, Discord bot in Python

    12 mars 2024, par Skely

    I followed a tutorial for making a discord bot and every time I type in a command I get the error message :

    &#xA;

    discord.ext.commands.errors.CommandNotFound: Command "play" is not found

    &#xA;

    It runs and shows to be online in my Discord server, I have given it every permission know to man, and checked through multiple times in my code to see if I find something wrong. But I don't see anything that can be changed or something that can fix it. I am in desperate need for help.&#xA;Thanks alot in advance !!

    &#xA;

    This is my files and code :

    &#xA;

    main.py

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;import os&#xA;&#xA;from help_cog import help_cog&#xA;from music_cog import music_cog&#xA;&#xA;bot = commands.Bot(command_prefix="?", intents=discord.Intents.all())&#xA;&#xA;bot.remove_command("help")&#xA;&#xA;bot.add_cog(help_cog(bot))&#xA;bot.add_cog(music_cog(bot))&#xA;&#xA;bot.run(os.getenv("TOKEN"))&#xA;&#xA;

    &#xA;

    music_cog.py

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;&#xA;from yt_dlp import YoutubeDL&#xA;&#xA;import yt_dlp as youtube_dl&#xA;&#xA;class music_cog(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;&#xA;        self.is_playing = False&#xA;        self.is_paused = False&#xA;&#xA;        self.music_queue = []&#xA;        self.YDL_OPTIONS = {"format": "bestaudio", "postprocessors": [{"key": "FFmpegExtractAudio", "preferredcodec": "mp3", "preferredquality": "192",}]}&#xA;        self.FFMPEG_OPTIONS = {"before_options": "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5", "options": "-vn"}&#xA;&#xA;        self.vc = None&#xA;        print("Success")&#xA;&#xA;    def search_yt(self, item):&#xA;        with YoutubeDL(self.YDL_OPTIONS) as ydl:&#xA;            try:&#xA;                info = ydl.extract_info(f"ytsearch:{item}", download=False)["entries"][0]&#xA;            except Exception:&#xA;                return False&#xA;        return {"source": info["url"], "title": info["title"]}&#xA;&#xA;    def play_next(self):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;&#xA;            m_url = self.music_queue[0][0]["source"]&#xA;&#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    async def play_music(self, ctx):&#xA;        if len(self.music_queue) > 0:&#xA;            self.is_playing = True&#xA;            m_url = self.music_queue[0][0]["source"]&#xA;&#xA;            if self.vc == None or not self.vc.is_connected():&#xA;                self.vc = await self.music_queue[0][1].connect()&#xA;&#xA;                if self.vc == None:&#xA;                    await ctx.send("Could not connect to the voice channel")&#xA;                    return&#xA;            else:&#xA;                await self.vc.move_to(self.music_queue[0][1])&#xA;            &#xA;            self.music_queue.pop(0)&#xA;&#xA;            self.vc.play(discord.FFmpegPCMAudio(m_url, **self.FFMPEG_OPTIONS), after=lambda e: self.play_next())&#xA;&#xA;        else:&#xA;            self.is_playing = False&#xA;&#xA;    @commands.command(name="play", aliases=["p", "playing"], help="Play the selected song from YouTube")&#xA;    async def play(self, ctx, *args):&#xA;        query = " ".join(args)&#xA;&#xA;        voice_channel = ctx.author.voice.channel&#xA;        if voice_channel is None:&#xA;            await ctx.send("Connect to a voice channel!")&#xA;        elif self.is_paused:&#xA;            self.vc.resume()&#xA;        else:&#xA;            song = self.search_yt(query)&#xA;            if type(song) == type(True):&#xA;                await ctx.send("Could not download the song. Incorrect format, try a different keyword")&#xA;            else:&#xA;                await ctx.send("Song added to queue")&#xA;                self.music_queue.append([song, voice_channel])&#xA;&#xA;                if self.is_playing == False:&#xA;                    await self.play_music(ctx)&#xA;    &#xA;    @commands.command(name="pause", help="Pauses the current song being played")&#xA;    async def pause(self, ctx, *args):&#xA;        if self.is_playing:&#xA;            self.is_playing = False&#xA;            self.is_paused = True&#xA;            self.vc.pause()&#xA;        elif self.is_paused:&#xA;            self.is_playing = True&#xA;            self.is_paused = False&#xA;            self.vc.resume()&#xA;&#xA;    @commands.command(name="resume", aliases=["r"], help="Resumes playing the current song")&#xA;    async def resume(self, ctx, *args):&#xA;        if self.is_paused:&#xA;            self.is_playing = True&#xA;            self.is_paused = False&#xA;            self.vc.resume()&#xA;        &#xA;    @commands.command(name="skip", aliases=["s"], help="Skips the currently played song")&#xA;    async def skip(self, ctx, *args):&#xA;        if self.vc != None and self.vc:&#xA;            self.vc.stop()&#xA;            await self.play_music(ctx)&#xA;&#xA;    @commands.command(name="queue", aliases=["q"], help="Displays all the songs currently in queue")&#xA;    async def queue(self, ctx):&#xA;        retval = ""&#xA;&#xA;        for i in range(0, len(self.music_queue)):&#xA;            if i > 4: break&#xA;            retval &#x2B;= self.music_queue[i][0]["title"] &#x2B; "\n"&#xA;&#xA;        if retval != "":&#xA;            await ctx.send(retval)&#xA;        else:&#xA;            await ctx.send("No music in the current queue")&#xA;    &#xA;    @commands.command(name="clear", aliases=["c", "bin"], help="Stops the current song and clears the queue")&#xA;    async def clear(self, ctx, *args):&#xA;        if self.vc != None and self.is_playing:&#xA;            self.vc.stop()&#xA;        self.music_queue = []&#xA;        await ctx.send("Music queue cleared")&#xA;&#xA;    @commands.command(name="leave", aliases=["disconnect", "l", "d"], help="Kick the bot from the voice channel")&#xA;    async def leave(self, ctx):&#xA;        self.is_playing = False&#xA;        self.is_paused = False&#xA;        await self.vc.disconnect()&#xA;&#xA;

    &#xA;

    help_cog.py

    &#xA;

    import discord&#xA;from discord.ext import commands&#xA;&#xA;class help_cog(commands.Cog):&#xA;    def __init__(self, bot):&#xA;        self.bot = bot&#xA;&#xA;        self.help_message = """&#xA;        Help message&#xA;"""&#xA;&#xA;        self.text_channel_text = []&#xA;    &#xA;    @commands.Cog.listener()&#xA;    async def on_ready(self):&#xA;        for guild in self.bot.guilds:&#xA;            for channel in guild.text_channels:&#xA;                self.text_channel_text.append(channel)&#xA;&#xA;        await self.send_to_all(self.help_message)&#xA;&#xA;    async def send_to_all(self, msg):&#xA;        for text_channel in self.text_channel_text:&#xA;            await text_channel.send(msg)&#xA;        &#xA;    @commands.command(name="help", help="Displays all the available commands")&#xA;    async def help(self, ctx):&#xA;        await ctx.send(self.help_message)&#xA;&#xA;

    &#xA;