sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

Add ability to view previous topics with .topic command

Open Anonymous4045 opened this issue 3 years ago • 15 comments

Relevant Issues

Closes #1145

Description

After a user invokes the ".topic" command and reacts with the reroll emoji, the embed will now show the previous few conversation prompts. It cannot display more than 256 characters because of the limit on embed title character length, which is usually around 5 prompts.

Did you:

Anonymous4045 avatar Nov 15 '22 04:11 Anonymous4045

I'll keep this open, but be sure next time to get your issue approved by a core dev before continuing with a PR.

Xithrius avatar Nov 15 '22 04:11 Xithrius

Could you share a screenshot of what this looks like after being used a few times?

I think we will also need to add a limit to the number of previous topics that get shown, if there isn't already present. Users could easily spam the button and cause a very large embed from the bot otherwise.

ChrisLovering avatar Nov 17 '22 11:11 ChrisLovering

Discord sets the limit on the number of characters in the title of an embed to be 256. From my testing, that seems to mean there's around 4 or 5 topics that can be on display at once. Personally I think 4 or 5 is enough for people to have something to talk about, so it seems good to me.

Here's some screenshots of my bot running the code

Screenshots

Anonymous4045 avatar Nov 17 '22 18:11 Anonymous4045

I think a better way to deal with this would be when a user clicks on the emoji the new topic becomes number 1 and the rest get pushed down a number.

I considered this,but this would change the ordering of the older messages. One point of adding this feature is so that people wanting to respond to a specific topic could include the number of that topic in with their reply, e.g. someone responding to the second conversation starter could say something like "For topic 2, ...". Changing the numbers could be confusing or change the sentence someone was referring to.

Anonymous4045 avatar Dec 22 '22 01:12 Anonymous4045

I think a better way to deal with this would be when a user clicks on the emoji the new topic becomes number 1 and the rest get pushed down a number.

I considered this,but this would change the ordering of the older messages. One point of adding this feature is so that people wanting to respond to a specific topic could include the number of that topic in with their reply, e.g. someone responding to the second conversation starter could say something like "For topic 2, ...". Changing the numbers could be confusing or change the sentence someone was referring to.

If we're going to go with that behaviour, we should remove the reaction button when it will no longer send a new topic.

ChrisLovering avatar Dec 22 '22 12:12 ChrisLovering

This seems good to me, the only thing I would suggest is limiting the number of prompts to 3, as 5 seems like quite a lot (i'd still leave the detection for when it goes over the title limit, just in case there are 3 really long topics).

Let's see what others think first though, as I don't mind too much and some people may prefer more.

wookie184 avatar Jan 15 '23 10:01 wookie184

Could you move the previous topics as part of the description instead? I feel like it might be too distracting to be in all bold and big like that

Robin5605 avatar Feb 25 '23 01:02 Robin5605

Could you move the previous topics as part of the description instead? I feel like it might be too distracting to be in all bold and big like that

We could do that, but there's a few things to work out first. What would the title in bold be? And what would we set the limit for the topics to show as, since we wouldn't be bound by the title character limit?

Anonymous4045 avatar Feb 27 '23 01:02 Anonymous4045

Hey @Anonymous4045, are you still planning to work on this?

I agree with wookie that allowing five topics simultaneously is a little too much, perhaps 3 could do. If a topic is approved in the repo, they should already be considered plausible topics. Keep in mind that people also like to reference the topic embed when replying to the topic. Having too many topics to choose from in that embed can lead to fragmented conversations, which one might say defeats part of the purpose of this .topic command in the first place.

Which also means, regarding Chris' suggestion to pop the first topic off and append new ones to the bottom: Breaking the topic number reference is a problem, like you said. So removing the ability to reroll altogether on the third[^1] time the emoji is reacted seems good enough.

This addresses both Chris' concern (with reaction not actually getting a new topic) and yours (people responding to Topic N).

[^1]: Or whatever the decided limit is.

What would the title in bold be?

Since titles are not mandatory, moving the topic from the title to the description could look better once the reroll emoji is reacted IMO.

So all that this PR needs now as far as I can tell is to 1) improve the UI (bold text) and 2) implement a reasonable behaviour to limit the number of topic rerolls allowed. What do you think?

hedyhli avatar Mar 27 '24 07:03 hedyhli

Sounds good to me. I can start working on this and see how it feels.

Anonymous4045 avatar Mar 27 '24 12:03 Anonymous4045

@Anonymous4045 Hello! Any updates on the progress of this PR? Thanks!

Xithrius avatar May 11 '24 21:05 Xithrius

@Xithrius thanks for the reminder! I've implemented most of what you said. I also tried switching the suggestion form to be a footer, but this seems to break the hyperlink. Do you know of a way to have links in the footer? We could also just make it in the description, but I think it looks better as a footer for formatting purposes. IMG_1315

Anonymous4045 avatar May 12 '24 01:05 Anonymous4045

Thank you for the update!

Footers in embeds do not support hyperlinks, unfortunately. I believe previously the link was just a part of the description.

Xithrius avatar May 12 '24 01:05 Xithrius

@Xithrius bummer. How's this instead?

IMG_1316

Anonymous4045 avatar May 12 '24 02:05 Anonymous4045

Looks good to me! I'll test out this PR on my local machine in the coming days.

Xithrius avatar May 12 '24 02:05 Xithrius