I'm trying to dynamically create our options menu in discord.py by iterating through a config.json file to create the options. I have one of the keys as "emoji" : "🟠" but when I try to assign it to a value in my function, I get the following error:
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In components.0.components.0.options.0.emoji.name: Invalid emoji
In components.0.components.0.options.1.emoji.name: Invalid emoji
Code where this is implemented here:
for i in config['login_info']:
select.add_option(
label=i["site"],
emoji=i["emoji"],
description=i["site"] + " Login"
)
I expect the orange emoji to populate the emoji variable, but it doesn't
Related
I have this function that basically sends messages to a chat group in telegram with data from new documentaries.
chat_id = *chat_number*
images = 'https://m.media-amazon.com/images/M/MV5BZGZjZDg0MzYtY2NhNy00YjM4LWI2YzQtYTk4Zjk0ZmRiY2VmXkEyXkFqcGdeQXVyOTU1MTMxOQ##._V1_.jpg'
message = bot.send_photo(chat_id, images, caption = text, parse_mode = 'HTML')
Normally it works but this link in particular (also another ones) raises an error in telegram. How could I do to avoid this error? I dont want to turn the url into a file and sending afterwards, there's any other option?
this is the error:
raise BadRequest(message)
telegram.error.BadRequest: Wrong file identifier/http url specified
thats a simple code and Cmd output line
bot name - #ting_ting_bot
Ok, instead of telebot.Telebot use telebot.TeleBot. Note that B in TeleBot.
In the docs of pyTelegramBotApi's docs it is provided:
import telebot
bot = telebot.TeleBot("TOKEN", parse_mode=None) # You can set parse_mode by default. HTML or MARKDOWN
My code is just await ctx.send(file = f, embed=embed)
But I get this error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: RuntimeError: Form data has been processed already
I would like to know why this error occurred and how to fix it.
I've used embeds for quite a while, however I haven't ever seen file = f used in the send line of an embed. This very well might be the issue, however I can't say for certain without seeing more of the code. Here is how I usually format an embed, if it helps.
embed = discord.Embed(
title="Embed title"
)
# You can add as many of these as you want. Change the title and value fields as needed
embed.add_field(name= "Field Title", value="Field Value")
await ctx.send(embed = embed)
I am writing auto test scripts in QTP (UFT).
I have multiple columns in an external datasheet which could contain data or be blank. I was trying write some code, that if it was blank to click a submit button, if not blank then add in the fields. Please see code below:
If IsNull(DataTable("Available_Qualifications_1", dtLocalSheet)) = False then
Browser("Create Qualification Types").Page("Create Qualification Types").WebList("qavailable").Select DataTable("Available_Qualifications_1", dtLocalSheet)
Browser("Create Qualification Types").Page("Create Qualification Types").Link("Add Qualifications").Click
ElseIf IsNull(DataTable("Available_Qualifications_1", dtLocalSheet)) then
Browser("Create Qualification Types").Page("Create Qualification Types").WebButton("Submit").Click
End if
However, I receive the error below:
Cannot identify the specified item of the qavailable object. Confirm that the specified item is included in the object's item collection.
Line (16): "Browser("Create Qualification Types").Page("Create Qualification Types").WebList("qavailable").Select DataTable("Available_Qualifications_1", dtLocalSheet)".
What UFT is saying is that you're trying to set a value into the WebList which isn't one of the WebList's options.
Try outputing the value to see if UFT is correct, if it is then correct your test (by entering the correct values in the data table). If it's not correct you can try using the index by using the Select "#3" syntax (and report the problem to HP's support).
Specifically, the chapter is about creating a new menu layout and the example uses the registration form. Whenever I try to create a new menu item with the alternate registration form through the admin, I get the following error:
Warning: simplexml_load_file(): file:///C:/xampp/.../com_users/registration/approval.xml:23: parser error : error parsing attribute name in C:\xampp...\menutypes.php on line 395
I get this error and a few other similar ones, they all seem to blow up on line 395 of the mentioned file. That line is:
if ($xml = simplexml_load_file($file))
how can I fix this? Thanks!!
My wild guess is that you should be using a comparison operator instead of an assignment operator:
if ($xml == simplexml_load_file($file))