ColumbiaSC-Tech / botty_mcbotface

General purpose Slack-bot with personality
MIT License
7 stars 0 forks source link

Having issues to setup this Bot #41

Closed netdevilz closed 5 years ago

netdevilz commented 5 years ago

Hello, I am missing something while setting up this bot. 1) Created virtualenv 2) Create settings and run files 3) pip install botty-mcbotface 4) python run.py

It's throwing error can't import TIMEZONE from settings file.

Can you someone help please?

DannyHinshaw commented 5 years ago

@netdevilz hey! Looks like you found a literal "undocumented feature" XD

I'll add this to the documentation, but real quick, that error comes from the init module here. All you need to do is add a variable to your slackbot_settings.py named TIMEZONE and give it a value that is compatible with pytz timezone feature. The app will then consume that and should fix the error.

Please let me know if this helps or not, sorry about that!

netdevilz commented 5 years ago

@DannyHinshaw Thanks for getting back. After adding TIMEZONE variable now it's throwing below error

(env) PS C:\Users\Zohaib\Desktop\newbot> python .\run.py
Traceback (most recent call last):
  File ".\run.py", line 4, in <module>
    from botty_mcbotface import log
  File "C:\Users\Zohaib\Desktop\newbot\env\lib\site-packages\botty_mcbotface\__init__.py", line 33, in <module>
    init_db()
  File "C:\Users\Zohaib\Desktop\newbot\env\lib\site-packages\botty_mcbotface\__init__.py", line 27, in init_db
    import botty_mcbotface.botty.db.routines
  File "C:\Users\Zohaib\Desktop\newbot\env\lib\site-packages\botty_mcbotface\botty\db\routines\__init__.py", line 1, in <module>
    from .routine_populate_db import *
  File "C:\Users\Zohaib\Desktop\newbot\env\lib\site-packages\botty_mcbotface\botty\db\routines\routine_populate_db.py", line 2, in <module>
    from botty_mcbotface.botty.api import get_all_channels, get_all_users
  File "C:\Users\Zohaib\Desktop\newbot\env\lib\site-packages\botty_mcbotface\botty\api.py", line 4, in <module>
    from run import bot
ImportError: cannot import name 'bot' from 'run' (C:\Users\Zohaib\Desktop\newbot\run.py)
(env) PS C:\Users\Zohaib\Desktop\newbot>
DannyHinshaw commented 5 years ago

That I am not sure of... what is your run.py contents and where did you place it?

DannyHinshaw commented 5 years ago

@netdevilz I see now, it's another literal undocumented feature

add:

bot = Bot()

to your run.py file above the main definition.