itspranavajay / stable-diffusion-telegram-bot

MIT License
27 stars 16 forks source link

No API KEY found #7

Open vasmarfas opened 1 year ago

vasmarfas commented 1 year ago

Traceback (most recent call last): File "/media/bad-hdd-nextcloud/nextcloud-data/Programms/stable-diffusion-telegram-bot/main.py", line 88, in app.run() File "/var/www/miniconda3/lib/python3.10/site-packages/pyrogram/methods/utilities/run.py", line 58, in run self.start() File "/var/www/miniconda3/lib/python3.10/site-packages/pyrogram/sync.py", line 66, in async_to_sync_wrap return loop.run_until_complete(coroutine) File "/var/www/miniconda3/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/var/www/miniconda3/lib/python3.10/site-packages/pyrogram/methods/utilities/start.py", line 52, in start is_authorized = await self.connect() File "/var/www/miniconda3/lib/python3.10/site-packages/pyrogram/methods/auth/connect.py", line 38, in connect self.load_config() File "/var/www/miniconda3/lib/python3.10/site-packages/pyrogram/client.py", line 616, in load_config raise AttributeError("No API Key found. More info: https://docs.pyrogram.org/intro/setup") AttributeError: No API Key found. More info: https://docs.pyrogram.org/intro/setup

What i have to do to make bot working?

vasmarfas commented 1 year ago

image

vasmarfas commented 1 year ago

image I just harcoded this in main.py and bot is working. It generates an image (i can see it by GPU load %), but don't send generated picture. Traceback: name 'url' is not defined Traceback (most recent call last): File "/var/www/miniconda3/lib/python3.10/site-packages/pyrogram/dispatcher.py", line 224, in handler_worker await self.loop.run_in_executor( File "/var/www/miniconda3/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/media/bad-hdd-nextcloud/nextcloud-data/Programms/stable-diffusion-telegram-bot/main.py", line 59, in draw response2 = requests.post(url=f'{url}/sdapi/v1/png-info', NameError: name 'url' is not defined