Coder Social home page Coder Social logo

Self Hosting about coronavirus-bot HOT 12 CLOSED

picklejason avatar picklejason commented on September 28, 2024
Self Hosting

from coronavirus-bot.

Comments (12)

picklejason avatar picklejason commented on September 28, 2024

Hi, thanks for using the bot.
Yes, it is possible to self host, but it may be difficult as I am constantly updating the bot so you may run to some errors as the GitHub is not updated as frequently. You only need to create a config file with the bot token and if you want the Reddit command as well, you'll need to include the Reddit info as well to host it.

from coronavirus-bot.

hng12 avatar hng12 commented on September 28, 2024

Hi, thanks for the reply! Would you be able to give me a template of the config file? As for the reddit thing, do I need an api key?

from coronavirus-bot.

picklejason avatar picklejason commented on September 28, 2024

Yes, if you wish to use the Reddit command you would need to make an Reddit application for requests.
Format for the config file the format should be:
token = ' '
redditID = ' '
redditSecret = ' '
redditPW = ' '
user_agent = ' '
redditName = ' '

from coronavirus-bot.

hng12 avatar hng12 commented on September 28, 2024

ah ok, thanks for the info. I tried installing dependencies by running pip install -r requirements.txt but it says "module google not found" when I run python covid-19.py. I also tried pip install google but same response. Any idea on how to fix this?

from coronavirus-bot.

picklejason avatar picklejason commented on September 28, 2024

@GenryMg I am hosting the bot on google cloud and I am using google logging as well. I didn't plan for people to self host so that is not in the requirements. If you wish you can get rid of all the logging (recommended option, unless you're planning to host on google as well). If you do host on google and want to log to it, then you have to install the library with pip install --upgrade google-cloud-logging

from coronavirus-bot.

hng12 avatar hng12 commented on September 28, 2024

I don't think I need the logging. Does the logging code only appear in covid-19.py? or is it all over the bot folder

from coronavirus-bot.

hng12 avatar hng12 commented on September 28, 2024

btw, I just remove this part right

import google.cloud.logging
from google.cloud.logging.handlers import CloudLoggingHandler


logging_client = google.cloud.logging.Client()
cloud_logger = logging_client.logger('covid-19')
logger = logging.getLogger('covid-19')
logger.setLevel(logging.DEBUG)
handler = CloudLoggingHandler(logging_client)
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)```

from coronavirus-bot.

picklejason avatar picklejason commented on September 28, 2024

Yes and any other instances of logging in the other files

from coronavirus-bot.

hng12 avatar hng12 commented on September 28, 2024

alright, thanks for your help! I will try again

from coronavirus-bot.

hng12 avatar hng12 commented on September 28, 2024

Uh, I tried to delete the lines dealing with logging. However, I don't know which ones to delete (Not familiar with GCP and google logging) Would you be able to tell me which files/lines I need to get rid of?

from coronavirus-bot.

picklejason avatar picklejason commented on September 28, 2024

Just CTRL+F anything with logger in in. Also, not to be rude, but as I said before I didn't plan for people to self host the bot so I can't help you with every issue.

from coronavirus-bot.

hng12 avatar hng12 commented on September 28, 2024

ok np. thanks for your help

from coronavirus-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.