Tag: DISCORD.PY
Entonces, mi código se ve así: main.py import (aquí están todas las importaciones requeridas) @bot.event async def on_ready(): print(‘———-‘) for filename in os.listdir(‘./cogs’): if filename.endswith(‘.py’): bot.load_extension(f’cogs.{filename[:-3]}’) bot.run(‘token’) music.py class Music(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command() async def join(self, ctx, *, channel: discord.VoiceChannel): (insertar el resto de los comandos . . . Read more
Estoy intentando conectar mi bot al mismo canal de voz en el que se encuentra el autor del comando y reproducir un video de su elección. Sin embargo, al ejecutar el siguiente código: @bot.command(‘play’) async def unirse(ctx, search: str): vc = discord.utils.get(ctx.guild.channels, name=ctx.author.voice) voice = await vc.connect() FFMPEG_OPTIONS = {‘before_options’: . . . Read more
@bot.event async def on_message(message): embed = discord.Embed( title=”anything”, description=f”كت تويت : \n {message.content} \n ||@here||” ) if message.channel.id == 927235996158922802: channelO = await bot.fetch_channel(926945495413301290) await channelO.send(embed) En este código, el bot me envía este mensaje de texto <discord.embeds.embed object=”” at=”” 0x0000019e83e31d80=””> en lugar del embed. No hay errores.</discord.embeds.embed>
Me estoy desesperando poco a poco por esto. Estoy intentando obtener una entrada muy específica de una base de datos previamente definida. Para esto, he definido mi base de datos: test = cluster[“folder1”][“example”] Dentro de esto hay keys con un value, que se ve algo así: Imagen de la base . . . Read more
Estoy tratando de encontrar un comando para expulsar a todos los miembros sin un rol en mi servidor de Discord. Busqué en Google + este sitio web y encontré soluciones que no parecen funcionar para mí. Esto es lo que intenté. import discord from discord.ext import commands from discord.ext.commands import . . . Read more