Skip to content

Commit

Permalink
Debug command
Browse files Browse the repository at this point in the history
  • Loading branch information
quartata committed May 7, 2018
1 parent cae3fae commit 34a9faf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions chatcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,11 @@ def listening():
return "Currently listening to:\n" + repr(GlobalVars.deletion_watcher.posts)


@command()
def last_feedbacked():
return datahandling.last_feedbacked


# noinspection PyIncorrectDocstring,PyProtectedMember
@command(str, whole_msg=True, privileged=True, arity=(0, 1))
def stappit(msg, location_search):
Expand Down Expand Up @@ -1471,7 +1476,7 @@ def false(feedback, msg, alias_used="false"):
except:
pass

if msg.content[-1] != "-" and not msg.content.endswith(alias_used):
if feedback.content[-1] != "-" and not feedback.content.endswith(alias_used):
Tasks.do(Metasmoke.post_auto_comment, feedback.content_source, feedback.owner, url=post_url)

return result if not feedback_type.always_silent else ""
Expand Down Expand Up @@ -1525,7 +1530,7 @@ def naa(feedback, msg, alias_used="naa"):
post_id, site, _ = fetch_post_id_and_site_from_url(post_url)
add_ignored_post((post_id, site))

if msg.content[-1] != "-" and not msg.content.endswith(alias_used):
if feedback.content[-1] != "-" and not feedback.content.endswith(alias_used):
Tasks.do(Metasmoke.post_auto_comment, feedback.content_source, feedback.owner, url=post_url)

return "Recorded answer as an NAA in metasmoke." if not feedback_type.always_silent else ""
Expand Down Expand Up @@ -1564,7 +1569,7 @@ def true(feedback, msg, alias_used="true"):
else:
result = "Registered " + post_type + " as true positive."

if msg.content[-1] != "-" and not msg.content.endswith(alias_used):
if feedback.content[-1] != "-" and not feedback.content.endswith(alias_used):
Tasks.do(Metasmoke.post_auto_comment, feedback.content_source, feedback.owner, url=post_url)

datahandling.last_feedbacked = ((post_id, site), time.time() + 60)
Expand Down

0 comments on commit 34a9faf

Please sign in to comment.