Removed strange file creation

This commit is contained in:
BarsTiger
2023-02-14 13:51:06 +02:00
parent dcdb4ef60d
commit 2d36b87360

View File

@@ -1,7 +1,6 @@
from aiogram import types from aiogram import types
from bot.db import db, DBTables from bot.db import db, DBTables
from bot.utils.cooldown import throttle from bot.utils.cooldown import throttle
import os.path
from bot.modules.api.txt2img import txt2img from bot.modules.api.txt2img import txt2img
@@ -12,14 +11,10 @@ async def txt2img_comand(message: types.Message):
await temp_message.edit_text("Specify prompt for this command. Check /help txt2img") await temp_message.edit_text("Specify prompt for this command. Check /help txt2img")
return return
if not os.path.isfile('adstring'):
with open('adstring', 'w') as f:
f.write('@aiistop_bot')
try: try:
image = await txt2img(message.get_args()) image = await txt2img(message.get_args())
await message.reply_photo(photo=image[0], caption=str( await message.reply_photo(photo=image[0], caption=str(
image[1]["infotexts"][0]) + "\n\n" + open('adstring').read()) image[1]["infotexts"][0]))
except Exception as e: except Exception as e:
assert e assert e
await message.reply("We ran into error while processing your request. StableDiffusion models may not be " await message.reply("We ran into error while processing your request. StableDiffusion models may not be "