Relative Content

Tag Archive for pythondiscorddiscord.py

I want to fetch a data from another python file everytime i execute the other one

I know that whenever i use from my_file_contains_data.py import data_i_want
i can access the data i want and i can use it for ‘if’ statements.
but in ‘my_file_contains_data.py’ file, the ‘data_i_want’ is a variable that can changes.
and when the ‘data_i_want’ changes, it does not change in the main file i work, it always stays the same value in the beginning.

How to sync slash command to Group Chat or User DM?

How to make my Discord Bot sync to Group Chat or User DM? There is a Discord Bot able to use the commands without inviting to Discord Server, and it works in Discord Group Chat and User DM’s. Is there a way to make my Slash Command sync to my own Group Chat?

how to read the messages in a thread in a forum channel

How do I read all messages on a Discord forum thread using discord.py? I am oblivious and have been looking everywhere but couldn’t find any solution. Can someone provide a detailed explanation or example code to help me out with this issue? Thank you!

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 […]