aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2022-12-04ditch prepare_self_assignable_roles_view by constructing the buttons inside ↵Gravatar shtlrs-21/+9
the view itself
2022-12-04make SELF_ASSIGNABLE_ROLES_MESSAGE more inviting for people to interact withGravatar shtlrs-1/+5
2022-12-04update custom id of the AllSelfAssignableRolesView's buttonGravatar shtlrs-1/+1
2022-12-04use button decorator instead of subclassing discord.ui.ButtonGravatar shtlrs-20/+10
This will help clarify the relationship between the button & the viw since it'll only be used there
2022-12-03rename #Roles section to #InformationGravatar shtlrs-1/+1
2022-12-03call super without referencing the current classGravatar shtlrs-1/+1
2022-12-03do not use name manglingGravatar shtlrs-3/+3
This also renames to method to align more with our fetch or {action} pattern
2022-11-27make the roles view ephemeral when sent in roles channelGravatar shtlrs-1/+2
2022-11-27add docstrings to RoleButtonViewGravatar shtlrs-6/+17
This documents the attributes the class has, which gives better context for future readers/contributors
2022-11-27misc style & doc improvementsGravatar shtlrs-3/+3
2022-11-27remove waring in setup docstringsGravatar shtlrs-1/+1
2022-11-27rename the method that attaches the persistent viewGravatar shtlrs-4/+12
This also enhances the docstrings for a better clarification of its purpose
2022-11-27update docs for the newly added view & buttonGravatar shtlrs-2/+2
2022-11-27Update return.md (#2325)Gravatar Steele Farnsworth-11/+8
Made the tag more brief without any substantial changes to its overall approach. Co-authored-by: wookie184 <[email protected]>
2022-11-27rename prepare_available_role_subscription_view to ↵Gravatar shtlrs-3/+3
prepare_self_assignable_roles_view
2022-11-27fix docstrings of the ShowAllSelfAssignableRolesButton's callback functionGravatar shtlrs-1/+1
2022-11-27update message content of the persistent viewGravatar shtlrs-2/+2
The messages were intended for a button that will automatically assign all availables roles to the interactor This changes since it's not the intended behavior
2022-11-27rename ClaimAllSelfAssignableRolesButton to ShowAllSelfAssignableRolesButtonGravatar shtlrs-5/+5
2022-11-27include Thread & PrivateChannel in get_or_fetch_channel return typesGravatar shtlrs-1/+3
2022-11-27Don't close already closed postsGravatar Chris Lovering-0/+6
2022-11-27restore original value of DELETE_MESSAGE_AFTERGravatar shtlrs-1/+1
2022-11-27rely on original_message to delete view once it times outGravatar shtlrs-66/+62
2022-11-26add implementation of the button's callback that'll handle assigning the ↵Gravatar shtlrs-0/+34
appropriate roles
2022-11-26add assignable_roles as a property to the ClaimAllSelfAssignableRoles buttonGravatar shtlrs-3/+4
2022-11-26add the logic for attaching the persistent viewGravatar shtlrs-1/+36
This comes with another dependency to try to locate the message that needs to hold the view. If that message is not found, a new one will be created & sent.
2022-11-26add the AllSelfAssignableRolesView and its corresponding ↵Gravatar shtlrs-1/+21
ClaimAllSelfAssignableRolesButton button Note that these are still dummy views & have no behavior
2022-11-26add the roles channel to the configGravatar shtlrs-0/+5
2022-11-26Catch case where starter message is deleted before pinningGravatar Chris Lovering-2/+4
2022-11-26Update CODEOWNERSGravatar Chris Lovering-1/+0
2022-11-26Ensure constants.Channels.help_system_forum is a forum channel on loadGravatar Chris Lovering-1/+3
2022-11-26Listen for thread starter on_message rather than thread_createGravatar Chris Lovering-10/+19
thread_create events are triggered before the thread's starter message is available, so listening for starter messages with on_message instead ensures we have a message object to use.
2022-11-26Auto archive help forum posts after inactivityGravatar Chris Lovering-1/+78
I decided to keep the archive logic simple, and just go for 30 minutes since last message, rather than the hybrid of 30 mins + 10 depending on who sent the last message. The reason for using the hybrid approach previously was due to us running out of channels frequently Since this is no longer a problem, I decided to keep the logic simple.
2022-11-26Don't load the help channel cog if disabledGravatar Chris Lovering-0/+7
2022-11-26Consistantly refer to help posts as posts, not threadsGravatar Chris Lovering-47/+47
2022-11-26Get, and store, the help forum channel object on cog loadGravatar Chris Lovering-4/+9
2022-11-26Ignore Discord errors when clearing snekbox reactionsGravatar Chris Lovering-2/+3
These errors can be caused by the message being deleted, or the message being in an archived thread
2022-11-26Update botcore module nameGravatar Chris Lovering-59/+59
2022-11-26Bump all deps to latestGravatar Chris Lovering-403/+303
2022-11-26Bump bot-core versionGravatar Chris Lovering-232/+236
2022-11-26Refactor Thread Error CatchingGravatar Hassan Abouelela-17/+17
Co-authored-by: Boris Muratov <[email protected]> Co-authored-by: Amrou Bellalouna <[email protected]> Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-26Handle Images As Starter MessagesGravatar Hassan Abouelela-1/+5
In the case of an image or other media as the starter message, the formatted message in the help DM will be empty, which is invalid for the embed. We populate the field with some more useful text in this case. Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-26Check If Thread Is Closed In PaginationGravatar Hassan Abouelela-55/+38
Similar to 555ed4e9, the pagination utility needs to catch when it's trying to act on an archived thread. Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-26Check If Thread Is Closed In wait_for_deletionGravatar Hassan Abouelela-1/+8
The wait_for_deletion utility would try to remove reactions from a message after the timeout expires, which would normally be fine. In threads however, they can be closed while waiting for the timeout to expire. In such a case, the bot will try to remove the reactions after the channel has been closed and fail. A special exception was added for this case to do nothing, since this is only a QoL feature. Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-26Catch Failure In Pining Help Starter MessageGravatar Hassan Abouelela-2/+7
The old method for detecting deleted opener messages does not seem to work, probably because the message is fetched from a cache or similar. Instead we simply try/except pinning the message and pass if the pinning failed. Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-26Don't Remove Cooldown Role From Non-Existing UsersGravatar Hassan Abouelela-0/+9
We try to remove the cooldown role from users before checking if the user is still in the server, which can cause an error since the thread object will just contain `None` as the user. Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-26Handle Discord API Not Being ReadyGravatar Hassan Abouelela-3/+7
When discord sends us the thread create event in help channels, it is not ready to perform other operations on the thread such as getting or pinning messages. This causes it to error out when we try to do these actions and claim that those channels don't exist. Instead, we sleep for a short time to try and wait for it to be ready. Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-26Simplify Help Thread Warning LogGravatar Hassan Abouelela-1/+1
The current warning log includes the thread name, which means the log message varies wildly between threads. This causes issues with sentry since the actual error message gets trimmed, and sentry fails to group issues from this log as they appear as different messages. Signed-off-by: Hassan Abouelela <[email protected]>
2022-11-25Send DM message to help post opener sooner in the processGravatar Chris Lovering-1/+2
This is to give Discord time to make the thread actually avaiulable to be posted in for the send_opened_post_message call Closes #2334 Closes BOT-3AW
2022-11-25Pin the user's starter message on help post creationGravatar Chris Lovering-0/+4
2022-11-25Add hf as an alias for the help-forum command groupGravatar Chris Lovering-1/+1