tux icon indicating copy to clipboard operation
tux copied to clipboard

Added no hello response to "hello" messages in support channels

Open koknese opened this issue 2 years ago • 1 comments

Description

This PR adds an automatic response in the support channel to any messages that only have "hello" or hi as the message content. The automatic response forwards them to a thread on how to ask good questions and nohello.net.

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • [+] I have followed all of these guidelines.

How Has This Been Tested? (if applicable)

Tested in the Tux dev server

Screenshots (if applicable)

Please add screenshots to help explain your changes.

Additional Information

Please add any other information that is important to this PR.

Summary by Sourcery

Add an automatic response feature in the support channel for messages with 'hello' or 'hi', guiding users to relevant resources. Enhance message handling with a new utility function to identify such messages.

New Features:

  • Introduce an automatic response in the support channel for messages containing only 'hello' or 'hi', directing users to resources on how to ask good questions and nohello.net.

Enhancements:

  • Add a utility function breaks_no_hello to check if a message in the support channel contains 'hello' or 'hi'.

koknese avatar Sep 19 '24 20:09 koknese

Reviewer's Guide by Sourcery

This pull request implements an automatic response to "hello" or "hi" messages in the support channel, directing users to resources on how to ask good questions. It also includes a minor comment about potentially replacing a custom function with a built-in Discord.py method.

File-Level Changes

Change Details Files
Implemented automatic response to 'hello' messages in support channel
  • Added a new method 'breaks_no_hello' to check if a message violates the 'no hello' policy
  • Implemented 'handle_no_hello_message' method to reply with guidance on asking questions
  • Updated 'on_message' event listener to call the new 'handle_no_hello_message' method
  • Set up a reply message with links to nohello.net and a specific Discord channel
  • Added a 10-second auto-delete for the reply message
tux/handlers/event.py
Added import for 'breaks_no_hello' function
  • Imported 'breaks_no_hello' function from tux.utils.functions
tux/handlers/event.py
Added a comment about potential code improvement
  • Suggested using message.clean_content instead of custom strip_formatting function
tux/handlers/event.py
Minor formatting change
  • Added a blank line at the end of the is_harmful function
tux/utils/functions.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

sourcery-ai[bot] avatar Sep 19 '24 20:09 sourcery-ai[bot]