Allen233443 / Google-Bard-Telegram-bot

A simple implementation of Google bard in Telegram
3 stars 4 forks source link

No module named `keep_alive` even if it is installed. #2

Open fernvenue opened 1 year ago

fernvenue commented 1 year ago

Hi, I'm trying to use this bot but I got this error when I run:

~/Google-Bard-Telegram-bot# python3 main.py
Traceback (most recent call last):
  File "/root/Google-Bard-Telegram-bot/main.py", line 5, in <module>
    import keep_alive
ModuleNotFoundError: No module named 'keep_alive'

I do installed keep_alive, and even if I tried to reinstall over and over again, still like that :(

Trotsvitalya commented 11 months ago

create host.py

from flask import Flask

from threading import Thread

app = Flask('')

app.route('/')

def main():
  return "Bot is online."

def run():
  app.run(host = "0.0.0.0", port = 8000)

def keep_alive():
  server = Thread(target = run)
  server.start()

This is what the keep_alive file contains, and name it like host.py or something. If you are naming it host.py then in your main.py you should add this too.

from host import keep_alive
keep_alive() #added at the bottom after all commands and line 70 edit