-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Allow using Discord threads #3362
base: master
Are you sure you want to change the base?
Conversation
This would be a nice idea, but this completely overwrites the whole system to threads which can be a problem. There are servers that would like to use the old/original behaiviour from the current modmail. So to have a chance for being considered it would be better to implement this as an optional feature with a configuration variable. |
I agree with this. If it were to be made a configurable option and thoroughly tested in an intensive environment, I’d be 100% okay with merging this. |
This still has the old behavior -- it only uses threads if |
Ah okay |
I have not tested everything yet but a few things I have noticed:
await channel.edit(topic=f"User ID: {user_id}")
TypeError: Thread.edit() got an unexpected keyword argument 'topic'
And may it would be better to let user configure it sth else. Because the variable name |
I'm unable to reproduce either of those -- do you have some steps I should follow? (I can see where in the code they happen and could blindly put guards up, but I want to know in what case they happen) |
I just used the config set command and configured the main_category_id to a text channel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 1305/1322 (including your changes) could be the issue. Also wondering why you didnt get this error. Have you tested it properly?
I've been testing repeating:
Obviously with stuff like checking switching 3 and 4. Nothing gets logged or breaks. I'll try looking at the code some more and see if I can see a way for maybe a .find call to race against sending a genesis message? |
I took a wild guess -- let me know if that fixes it (I am still unable to repro...) (for people skimming this PR: I changed modmail threads to cache only when completely initialized, including their first message) |
Absolutely hacky support for Discord threads. There's a couple important details about Discord threads:
The lack of topic support is troubling given that Modmail stuffs thread information into the channel topic. I updated some things to work based off the genesis message and -- since that does not contain the title -- disallowed setting titles for thread in Discord threads.
This can be used by setting
main_category_id
to a text channel, rather than a category channel. It worked in some basic tests I did locally, but I haven't checked in a more intensive environment.