Relative Content

Tag Archive for pythondiscorddiscord.py

How to make a discord bot join my voice channel using interaction (slash commands) (Python)

@client.tree.command(name = “join”, description = “Makes the bot join your voice channel.”) async def join(interaction: discord.VoiceChannel): try: if interaction.guild.voice_client: channel = interaction.guild.voice_client.channel await channel.connect() await interaction.response.send_message(content = “I joined the voice channel!”) elif not interaction.message.author.voice: await interaction.response.send_message(content = “You have to join a voice channel to use this command!”) except: await interaction.response.send_message(content = “I’m already […]

Discord slash commands with python and failing

I am setting up a discord.py file for a discord bot I have. Everything is going smooth so far, I got messages sending working, but not commands, I started setting it up, but now having issues. I have gone to several other posts, but to no avail.

Discord.py Bot regularly being rate limited

I’m very new to coding and, as my first “big” project, attempted to create a music bot in discord. I’m currently running into the issue that the bot regularly gets rate limited despite not being used by a lot of users (300 servers). I’m not sure what parts of my code I can change/optimize to make fewer API calls and still have all my functionalities remain the same. I’m hoping someone more experienced can give me a header here. Thanks!

How do I get my main discord python file to run other py files?

I am currently running a python API that runs my main.py discord bot file as a subprocess and I don’t really want to create another subprocess for each subsequent files that I add to my project. I am currently working on an Analytics.py file that I am running on the side with a test bot while my main bot continues to run, and I want to know how I can run my Analytics.py file in my main.py without creating another subprocess in my API.py.

How to remove duplicate slash commands (discord.py)

I’m relatively new to Discord.py, and I have a bot that seems to be experiencing a peculiar problem. Not too long after being started as a service on my remote Ubuntu server, the bot will begin duplicating certain commands (if not all of them), as seen in Discord’s slash command interface.