Skip to content

Conversation

@Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented May 12, 2022

Overview

Implements and closes #444 .

This provides a thread based help system, replacing our current channel based help system.

The system consists of two channels:

  • the staging channel #ask_here, the go-to channel to ask questions:

ask_here

  • the overview channel #active_questions, the go-to channel for helpers:

active_questions

How to ask

Ask command

The main way to ask questions is by using the /ask command in the staging channel. Users can select a title and a category:

ask command enter
ask command created

The bot then creates a thread for the question, adds the asker and all helpers interested in the selected category. The user can now proceed and enter their details in the thread:

question thread

Implicit ask, fallback

Additionally, there is a fallback mechanism that catches everyone not using the /ask command but just posting directly into the channel:

ask directly

The bot picks this message up, crafts a title by taking the first words of the text and creates a proper question thread for the user. The original message of the user will be deleted for cleanup and transferred to the thread instead:

bot reaction
thread created

How to help

Helpers can either drop in and out as they want, using the overview provided in the overview channel (#active_questions) or the full thread list provided in Discord:

threads

Or they select categories they are interested in, via a dialog in the overview channel:

select helper roles

Helpers are then automatically added to threads about these topics. The role settings can be adjusted at any time, allowing helpers to opt in and out as they want.

Extras

Close

Once the question is resolved, it can be closed using the /close command. Otherwise, it will automatically be closed after 24h of inactivity:

close

Change category

If users selected the wrong category for their questions, the /change-help-category command can be used to adjust the category in hindsight:

change category

Helpers for the new category are automatically added to the question thread.

Config

The config changed, we removed the old free-system:

"freeCommand": [
    {
        "inactiveChannelDuration": "PT2H",
        "messageRetrieveLimit": 10,
        "statusChannel": <put_a_channel_id_here>,
        "monitoredChannels": [
            <put_a_channel_id_here>
        ]
    }
]

and therefore added the new help system:

"helpSystem": {
   "stagingChannelPattern": "ask_here",
   "overviewChannelPattern": "active_questions",
   "categories": [
       "Java",
       "Frameworks",
       "JavaFX|Swing",
       "IDE",
       "Build Tools",
       "Database",
       "Minecraft",
       "Android",
       "C|C++",
       "Algorithms",
       "Math",
       "Architecture",
       "Code Review",
       "Together Java Bot",
       "Other"
   ],
   "categoryRoleSuffix": " - Helper"
}

For the system to work, you have to create the following channels (adjust based on your config):

  • #ask_here
  • active_questions

and the following roles:

  • Java - Helper
  • Frameworks - Helper
  • JavaFX|Swing - Helper
  • ... (for all categories in the config)

Checklist

  • Create threads upon slash command
  • Thread overview
  • Thread overview has to be updated constantly
  • Command to manually archive/close a thread after its done
  • Top-Helper support
  • Auto-archive inactive threads (use built-in functionality?)
  • Selectable tags for questions
  • Tags have to be adjustable after thread creation
  • Auto-add everyone with a role corresponding to a tag
  • Pickup free messages without slash command and convert them
  • User cooldown to prevent thread creation spam on accidental multi-message send
  • Attempt to invite via role ping instead of manual adding
  • Cleanup bot messages in the staging area to keep it clean (after some time)
  • Group active questions by tags
  • Ensure (at least) author can reopen their channel for follow-ups (anyone can unarchive without extra perms)
  • Fix bug with overview being too late for fresh channels
  • Code polish (and FIXMEs)
  • Javadoc
  • UX/UI polish
  • Wait for /role-select to be fixed (needed for category roles)

Beta 1

  • bug with update overview if last message is not from bot
  • DELETE_MESSAGE_AFTER -> change 5min to 2min
  • bot crashes if /change-category in manually created thread
  • add basic explanation on how to ask questions as header to all threads
  • explore possibility to ping helpers after actual question has been posted (first message of author?), or maybe just after 1 minute. gives enough time to flesh out the question

@Zabuzard Zabuzard added enhancement New feature or request new command Add a new command or group of commands to the bot priority: major labels May 12, 2022
@Zabuzard Zabuzard added this to the Improvement phase 1 milestone May 12, 2022
@Zabuzard Zabuzard self-assigned this May 12, 2022
@Zabuzard
Copy link
Member Author

proof of concept:

poc

@Zabuzard
Copy link
Member Author

PoC for help overview:

overview poc

@Zabuzard
Copy link
Member Author

close

@Zabuzard
Copy link
Member Author

implicitAsk1

implicitAsk2

@Zabuzard
Copy link
Member Author

user cooldown

@Zabuzard
Copy link
Member Author

helper
tags

@Zabuzard
Copy link
Member Author

change category

Copy link
Member

@Tais993 Tais993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just quick comments while looking through the code

@Zabuzard
Copy link
Member Author

Try: Ping role instead of adding everyone to the thread manually, but:
event.reply(....).allowedMentions(Collections.emptyList()); to not actually ping them.

@Zabuzard Zabuzard linked an issue May 20, 2022 that may be closed by this pull request
@Zabuzard
Copy link
Member Author

none
category grouping

@Zabuzard Zabuzard force-pushed the feature/thread_based_help branch from a89ec53 to af053de Compare May 21, 2022 21:25
@Zabuzard
Copy link
Member Author

Try: Ping role instead of adding everyone to the thread manually, but: event.reply(....).allowedMentions(Collections.emptyList()); to not actually ping them.

Did not work. Instead, try adding the ping via message edit in hindsight.

@Zabuzard
Copy link
Member Author

change cat invite
invite via ask

@Zabuzard
Copy link
Member Author

Zabuzard commented May 22, 2022

suggest change cat

@Zabuzard
Copy link
Member Author

Results of first beta test:

  • bug with update overview if last message is not from bot
  • DELETE_MESSAGE_AFTER -> change 5min to 2min
  • bot crashes if /change-category in manually created thread
    RestAction queue returned failure: [ErrorResponseException] 50001: Missing Access
  • add basic explanation on how to ask questions as header to all threads
  • explore possibility to ping helpers after actual question has been posted (first message of author?),
    or maybe just after 1 minutes. gives enough time to flesh out the question

@Zabuzard Zabuzard force-pushed the feature/thread_based_help branch from 9173aad to 73dbeaf Compare June 2, 2022 07:48
@Zabuzard Zabuzard marked this pull request as ready for review June 3, 2022 08:55
@Zabuzard Zabuzard requested review from a team as code owners June 3, 2022 08:55
@Zabuzard Zabuzard force-pushed the feature/thread_based_help branch 3 times, most recently from 3ad6f75 to 8505f2f Compare June 3, 2022 09:14
PoC for thread overview

Auto update more frequently, adding close command

Removed old free-system

Adjust top helper system

Implicit ask listener, invite author to thread, more stable listening

Added user cooldown

Adjusted cooldown time

Adding tags and auto-invite helpers

tag -> category (to avoid confusion with tag system)

Change help category command

Added categorizing of active question overview

getGuilds() -> getGuildCache() (CR Tais)

Bot message cleanup routine

invite helpers via soft-ping

Fixed some bug with the overview

sorting overview by creation time desc

changing cleanup timer 5min -> 2min

Bugfix with overview message retrieval

added "how to ask" explanation

improved "how to ask" explanation

Bugfix wrong messages selected as status messages

Removed code duplication, code polish

Javadoc

bugfix with change category not matching

Fixed missing docs

Overloads should be placed next to each other (linter)
@Zabuzard Zabuzard force-pushed the feature/thread_based_help branch from 8505f2f to a1d3e54 Compare June 3, 2022 09:16
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Zabuzard
Copy link
Member Author

Merging after 7 days of inactivity

@Zabuzard Zabuzard merged commit 2c386dc into develop Jun 10, 2022
@Zabuzard Zabuzard deleted the feature/thread_based_help branch June 10, 2022 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new command Add a new command or group of commands to the bot priority: major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create thread-based help system make Help System use discord threads

3 participants