athphane / userbot

Consider using f-strings PYL-C0209
Performance
Minor
6 months ago2 years old
Formatting a regular string which could be a f-string
38                return
39
40            try:
41                await message.edit("```Making a Quote\nProcessing {}%```".format(progress))42            except:
43                await message.edit("ERROR")
44
Formatting a regular string which could be a f-string
 7from userbot import UserBot
 8from userbot.plugins.help import add_command_help
 9
10mention = partial("<a href='tg://user?id={}'>{}</a>".format)11
12hmention = partial("<a href='tg://user?id={}'>\u200B</a>{}".format)
13
Formatting a regular string which could be a f-string
 66    else:
 67        evaluation = "Success"
 68
 69    final_output = "<b>Expression</b>:\n<code>{}</code>\n\n<b>Result</b>:\n<code>{}</code> \n".format( 70        cmd, evaluation.strip()
 71    )
 72
Formatting a regular string which could be a f-string
53        return
54
55    CARBON_LANG = type_text
56    await message.edit_text("Carbon type set to {}".format(type_text))57    await sleep(2)
58    await message.delete()
59
Formatting a regular string which could be a f-string
25
26    await message.edit_text("Carbonizing code...")
27    # Do the thing
28    os.system("carbon-now -h -t userbot/downloads/carbon {}".format(file))29    # await message.edit_text("Carbonizing completed...")
30    # Send the thing
31    await bot.send_photo(message.chat.id, "userbot/downloads/carbon.png")