bots

Chrome opens website and Immediately Closes when Using Selenium and Python

Chrome opens website and Immediately Closes when Using Selenium and Python Question: Chrome Version : 110.0.5481.104 Chrome Driver Version: 110.0.5481.77 From What I have heard last digits of the version do not matter. Its just a Simple Piece of Code:- from selenium import webdriver import os os.environ[‘PATH’] =r"C:/Users/xxxx/Desktop/xxxx/Selenium/chromedriver_win32/chromedriver.exe" driver=webdriver.Chrome() driver.get("https://phptravels.com/demo/") Chrome Opens up shows the …

Total answers: 1

How to edit images in embeds (discord.py)

How to edit images in embeds (discord.py) Question: I have a command that generates a random color palette and it works pretty well. Then I wanted to add a button to it, a button that’d generate a new palette. I added the button, wrote a callback, but the callback just won’t work, because the interaction.response.edit_messsage() …

Total answers: 1

How can i make my discord.py bot kick command optional reason section to a required reason?

How can i make my discord.py bot kick command optional reason section to a required reason? Question: @bot.tree.command(name="kick", description="Kicks specified user from the server.") async def kick(interaction: discord.Interaction, member: discord.Member, reason: Optional[str] = None): if interaction.user.guild_permissions.kick_members: await member.kick(reason=reason) embed = discord.Embed(title="Successfully Kicked.",description=f"{member.mention} has been successfully kicked off the server.nFor {reason} reason.", color = discord.Color.green(), timestamp …

Total answers: 2

How Can I Make a discord.py Bot Leave While Using a Command Tree

How Can I Make a discord.py Bot Leave While Using a Command Tree Question: I have spent over an hour on this. I am using command trees so that my commands will show up as slash commands. I already have a command to join a voice chat, however I cannot figure out how to leave. …

Total answers: 1

How do I add a discord category to a server through a bot?

How do I add a discord category to a server through a bot? Question: In order to quickly set up a server, I’m trying to construct a discord bot in Python that accepts the command "!Create {Category name here}" and then generates a category packed with text channels from a list of strings stored in …

Total answers: 1

How do you get a message from a channel?

How do you get a message from a channel? Question: channel = bot.get_channel(id_of_the_channel) message = await channel.fetch_message(id_of_the_message) I tried to use this code so that a bot could edit its own message, but there’s an error on the line with "fetch_message". File "main.py", line 280, in on_message message = await channel.fetch_message(messageid) AttributeError: ‘NoneType’ object has …

Total answers: 1

Python Telegram Bot answer

Python Telegram Bot answer Question: How can I get response from Telegram bot and get some information to answer from local file? I wrote code below, but part with current_status doesn’t work. Could you please tell me why it doesn’t work? import telebot import requests url = "https://link.com" bot = telebot.TeleBot(‘TOKEN’) @bot.message_handler(content_types=[‘text’]) def get_text_messages(message): if …

Total answers: 1

Python Telegram Bot – Calling variable in URL?

Python Telegram Bot – Calling variable in URL? Question: am having difficulty calling a variable as part of the url in a message I intend to send via the Python Telegram bot. Due to the nature of my code, the ‘webpage’ variable varies and the url has to be called as a variable. Placing the …

Total answers: 1

How to make a discord bot use other discord bot commands?

How to make a discord bot use other discord bot commands? Question: im creating a discord bot in python and i would like to make my bot command the music bot to play music. for example i want my bot to write /play prompet:[SONG_NAME] in a chat room and let it be recognized and played …

Total answers: 1