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

Add transfer question feature #885

Closed
wants to merge 0 commits into from
Closed

Add transfer question feature #885

wants to merge 0 commits into from

Conversation

ankitsmt211
Copy link
Member

@ankitsmt211 ankitsmt211 requested review from a team as code owners September 17, 2023 11:23
Copy link
Member

@Taz03 Taz03 left a comment

Choose a reason for hiding this comment

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

cal u explain what this transfer feature is all about?

private static final String TRANSFER_QUESTION_TITLE_ID = "transferID";
private static final String TRANSFER_QUESTION_INPUT_ID = "tranferQuestion";
private static final String TRANSFER_QUESTION_TAG = "tags";
private static final String QUESTIONS_CHANNEL_ID = "1051826284008853505";
Copy link
Member

Choose a reason for hiding this comment

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

don't hard code this and use longs for channel id

Copy link
Member Author

Choose a reason for hiding this comment

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

Any suggestions? Get channel by name maybe?

Copy link
Member

Choose a reason for hiding this comment

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

yes, get channel name from config

@ankitsmt211
Copy link
Member Author

cal u explain what this transfer feature is all about?

Any one with role higher or equal to Community Ambassador, can transfer questions from any non-question channel, it will create a modal and prefill all the values. Once submitted, the question will be posted in question forums, original message will be deleted. A dm will be sent to user as a soft warning.

@SquidXTV
Copy link
Member

Thanks for the work done ❤️

@Zabuzard
Copy link
Member

please share screenshots of every part of the flow. otherwise its very hard to review the UX part of things

@ankitsmt211
Copy link
Member Author

  1. context menu of any text

transfer-feature-1

  1. Sometimes modal creation fails, but you can either click on reload icon on fail message or do it again.

transfer-feature-2

  1. Prefill modal menu, values can be tweaked.

transfer-feature-3

  1. on Submit, new post is created in questions forum with "Java" tag as default.

transfer-feature-4

  1. Link and info about action is pasted in original channel, also you can see the original message is deleted as well.

transfer-feature-5

  1. DM'd user

Screenshot 2023-09-18 151433

  1. Unauthorized user tries to use this command

transfer-feature-6

@ankitsmt211
Copy link
Member Author

If anyone could review if log messages are detailed enough, thanks. Also, i missed something in here "mentioning" author of question in newly created post. I'll add that as well.

Comment on lines 103 to 106
TextInput transferQuestionTag = TextInput
.create(TRANSFER_QUESTION_TAG, "Transfer question tags", TextInputStyle.SHORT)
.setValue("Java")
.build();
Copy link
Member

Choose a reason for hiding this comment

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

use selection menu, get the list from config

Copy link
Member

Choose a reason for hiding this comment

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

@Taz03 modals only support text input according to JDA doc

Copy link
Member

Choose a reason for hiding this comment

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

so theres no better way to do that?

Copy link
Member

Choose a reason for hiding this comment

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

Theres this StringSelectMenu maybe we can send it before or after the main modal

Copy link
Member

Choose a reason for hiding this comment

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

im not sure if u can make this an ephemeral dialog though. perhaps sth to explore, but i would also be okay if we have that in a second iteration of the feature instead, cause it sounds complex

event.getJDA()
.getForumChannelById(QUESTIONS_CHANNEL_ID)
.createForumPost(forumTitle, forumMessage)
.setTags(ForumTagSnowflake.fromId(javaTag.getId()))
Copy link
Member

Choose a reason for hiding this comment

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

y always javaTag

Copy link
Member Author

@ankitsmt211 ankitsmt211 Sep 20, 2023

Choose a reason for hiding this comment

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

Earlier suggestion was to include a selection menu but didn't seam feasible, used java as it's default and most used tag. Plus this is just a feature to be used as "last resort" clean up tool not to be used primarily.We also wanna make it quicker for moderator to be able to use this quickly without much hassle that's why most values are also prefilled. If any post do not belong to certain category, any helper can see that and change category.

Copy link
Member

Choose a reason for hiding this comment

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

hmm, but this won't work anyways coz u can't just hard code the java tag, it is a config thing. The best option I can think of is having a selection menu

Copy link
Member

@Zabuzard Zabuzard Sep 21, 2023

Choose a reason for hiding this comment

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

u could read the config. the tags there are sorted by relevance, the first one is always considered the main mega tag

config

the bot uses that to determine who to ping if multiple tags are selected

Copy link
Member Author

Choose a reason for hiding this comment

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

this one is still not implemented, ill do this one hopefully soon.

@ankitsmt211
Copy link
Member Author

@Taz03 you mentioned something about getting channel from config, are you suggesting "regex pattern" for helper forum? Maybe get a list of all channels and match with that to get the target channel?

@ankitsmt211
Copy link
Member Author

Not a fan of "three" back to back mentions are being triggered here for OP

  • on creation of new post
  • private DM
  • link to newly created post in source channel

@Taz03
Copy link
Member

Taz03 commented Sep 21, 2023

@Taz03 you mentioned something about getting channel from config, are you suggesting "regex pattern" for helper forum? Maybe get a list of all channels and match with that to get the target channel?

yes

@marko-radosavljevic
Copy link
Contributor

Not a fan of "three" back to back mentions are being triggered here for OP

* on creation of new post

* private DM

* link to newly created post in source channel

I agree, let's get rid of the mention in source channel.

That way we don't annoy and confuse the newcomer with mentions all over the place. They only get mentioned where we want them to go, to a correct help thread. Additionally, we keep the source channel clean, and don't interrupt ongoing discussions.

Seems like a cleaner and more streamlined approach. ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transfer question Context Command
5 participants