Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing shows up in command prompt after I run reddit_bot.py #5

Open
andrewcreed opened this issue Jul 18, 2019 · 12 comments
Open

Nothing shows up in command prompt after I run reddit_bot.py #5

andrewcreed opened this issue Jul 18, 2019 · 12 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@andrewcreed
Copy link

As mentioned in my previous issue, after using the fix suggested, the errors no longer show up (which is good!"), however, nothing else shows up either after running reddit_boy.py. Is it meant to? Furthermore, none of my trigger words seem to interest my bot, who would rather remain silent than do as I command.

@fzanettini fzanettini self-assigned this Jul 18, 2019
@fzanettini fzanettini added the question Further information is requested label Jul 18, 2019
@fzanettini
Copy link
Member

This might sound silly, but is the process really being executed, i.e. hanging? Or does the script finish executing quickly without any outputs?

Also, how is your logs configuration file?

@andrewcreed
Copy link
Author

andrewcreed commented Jul 19, 2019

If I run the script, it just shows the command of executing it, but not much else, but the command prompt remains open.

My logging-config file contains the following:

[loggers]
keys=root,sLogger

[handlers]
keys=consoleHandler,fileHandler

[formatters]
keys=fileFormatter,consoleFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler

[logger_sLogger]
level=DEBUG
handlers=consoleHandler,fileHandler
qualname=sLogger
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=WARNING
formatter=consoleFormatter
args=(sys.stdout,)

[handler_fileHandler]
class=FileHandler
level=DEBUG
formatter=fileFormatter
args=('logfile.log',)

[formatter_fileFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
datefmt=

[formatter_consoleFormatter]
format=%(levelname)s - %(message)s
datefmt=

I have a feeling this may be the problem.

@fzanettini
Copy link
Member

fzanettini commented Jul 19, 2019

The consoleHandler, which is a StreamHandler to stdout, has log level as WARNING and most logs in the bot are on level INFO, which would not appear on a WARNING level log.

Can you try to change that and see if the logs give us any hints?

@andrewcreed
Copy link
Author

Changing it to DEBUG yielded the following results.

INFO - Started Reddit bot INFO - Running on environment: TEST INFO - Got subreddit names: bot running on 2 subreddits INFO - Loaded blocked users list: 2 users INFO - Instantiated Reddit client INFO - Got posts that were already replied

However, the bot is still not replying to anyone. He's being very anti-social for a bot.

@fzanettini
Copy link
Member

It's great the logs are now being prompted in std_out!

From the log messages, it seems the Reddit API client is being instantiated correctly and the bot remains in the "listening" state until it fetches a trigger word. I assume there is an issue with the trigger words, can you share your trigger words file and one example when you try to call the bot?

@andrewcreed
Copy link
Author

I can give you around eighteen examples of me attempting to summon this dishonorable bot.

This is the triggers file.

[[  
    "leto",
    "jared leto",
    "leto joker"
 ]]

@fzanettini
Copy link
Member

I think the issue is that your triggers file is using a nested list, and thus the check is run on the first list, which only contains the actual list with the keywords, and so it is checking against an "empty" list of triggers.

Can you try and remove one pair of the [ and ] characters in your triggers file as in the example?

@andrewcreed
Copy link
Author

I have removed one of the pairs, and it still is not responding. I'm not sure why there was two pairs in the first place.

@fzanettini
Copy link
Member

It seems the bot remains listening for the trigger words. Is there anything in the blocked_users list?

@andrewcreed
Copy link
Author

Sorry about the delay in responding.

The blocked_users list is the same as the one provided by you.

@fzanettini
Copy link
Member

Sorry about the delay as well. It seems this was indeed a bug and now it is solved in the following pull request:

bobby-b-bot/utils#4

Can you update and retry?

@fzanettini fzanettini added the bug Something isn't working label Aug 24, 2019
@andrewcreed
Copy link
Author

andrewcreed commented Aug 24, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants