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

!!/report messages should be added as a comment on MS #2398

Closed
angussidney opened this issue Sep 7, 2018 · 6 comments · Fixed by #3352
Closed

!!/report messages should be added as a comment on MS #2398

angussidney opened this issue Sep 7, 2018 · 6 comments · Fixed by #3352

Comments

@angussidney
Copy link
Member

angussidney commented Sep 7, 2018

Scroll down for up-for-grabs summary and guidance.

The !!/report command can take an optional 'custom reason' argument. The current implementation simply adds some extra text to the 'why' info for the report.

It would be ideal if this also added a comment to the MS post on behalf of the command user, so that the message is prominently shown on the MS post itself, along with the other comments.

Note: when Smokey reports a post, it doesn't know the the MS ID and thus can't send a request to /comments/post to add a comment. There are two potential workarounds for this:

  • Wait for a few seconds before sending the posts-by-url followed by add comment request (could we use the tasks system for this?)
  • Add a new optional field to the MS post creation process, which will post the comment once the post is created. (note that this will require some MS dev work).
@angussidney
Copy link
Member Author

If we can make a decision on which approach we wish to take, and do any MS dev if necessary, this should be a good [hacktoberfest] issue.

@iBug
Copy link
Member

iBug commented Sep 7, 2018

Contributor Guidance

Summary

Difficulty:
2/5 stars

SmokeDetector has a chat-based command interface which allows you to report a post on Stack Overflow or one of the other sites we monitor as possible spam. The chat bot then basically relays the report to the back-end server using its API.

This issue involves sending data to metasmoke with delaying and retrying. It's relatively easy given that there is working code around that you can adopt from.

Guidance

You'll need to modify the report_posts function in chatcommands.py. Once the report is posted (after the handle_spam call), you'll need to kick off an async task (using Tasks.later()) to send the report reason (if there was one) to metasmoke as a comment. You can create a new function that tries to post a comment to metasmoke, by calling Metasmoke.post_auto_comment() with proper arguments. Then you can use Tasks.later() to start this function from report(), with an appropriate delay.

There is already another example of posting comments to metasmoke, and it's easy to adopt once you figure out how each function works.

How to get help

For additional support in completing this issue, either:

  • comment on this thread
  • if you have a Stack Overflow account, drop into our chatroom (you'll need 20 reputation - if you don't have that, let the issue owner know your username or ID here so they can arrange for access)

@gparyani
Copy link
Contributor

@angussidney You sure that that's the right line?

@ArtOfCode-
Copy link
Member

@gparyani the code has changed since. I've fixed it.

@dineshkrishnareddy
Copy link
Contributor

hi @angussidney is this issue still open? Can i work on this

@angussidney
Copy link
Member Author

angussidney commented Oct 3, 2019

Of course @dineshkrishnareddy! Feel free to go right ahead, we'd love to have your help!

If you need any help, leave a comment of jump into our chatroom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

8 participants
@dineshkrishnareddy @angussidney @makyen @gparyani @iBug @ArtOfCode- and others