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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挕 Customize default title for auto-threads #29

Closed
MarcusOtter opened this issue Jan 12, 2022 · 23 comments 路 Fixed by #250
Closed

馃挕 Customize default title for auto-threads #29

MarcusOtter opened this issue Jan 12, 2022 · 23 comments 路 Fixed by #250
Labels
improvement 馃挕 Improvement suggestion

Comments

@MarcusOtter
Copy link
Owner

MarcusOtter commented Jan 12, 2022

Is your request for improvement related to a problem? Please describe.
From MumbleMarvin#2812 on Discord:

Only thing that would be cool if there were customize options for the autocreate thread titles.
Like "use message", "use image name", "use link title" or stuff like this

Right now the default title for a thread is Username (yyyy-MM-dd). As Marvin points out, it would be nice if this was customizeable.

Describe the solution you'd like

Title options (?):

  • Name (yyyy-MM-dd)
  • First X characters of message
  • First line of message
  • Use image alt text (if possible? also, what's the fallback if no image here)
  • Use link title (sounds like we need to do a HTTP request and like scrape the title but I could be wrong. also, what's the fallback?)

Perhaps the default can be Name (yyyy-MM-dd) but if an image or link exists, override it? Though that has problems if someone links to, say, documentation for some programming thing as a source for their question, you wouldn't want that to override. Needs some thinking about.

Solutions:

  • Option A
    When creating a thread, add another optional parameter for the default thread title, where you are given different options.
    Something like /configure autothreading channel: #general default-title: First X characters of message

  • Option B
    A new command like /configure default-title value: First X characters of message which would set the default for all auto-threads.

Additional context
Leaning towards Option A because it's not an extra command, and it would be configurable on a per-channel basis.
Would like feedback on the different title options!

@MarcusOtter MarcusOtter added the improvement 馃挕 Improvement suggestion label Jan 12, 2022
@Madis0
Copy link

Madis0 commented Jan 15, 2022

I think you could do all of those variants with variables? Similar to the way default messages have $USER.

  • $DATE(format) - date in the user-specified format, e.g. $DATE(yyyy-MM-dd)
  • $FIRSTCHARS(count) - first X characters of the message*
  • $LINKTITLE(count) - image alt text OR link title OR image filename OR link url OR first X characters of the message*
  • $LINKURL(count) - image filename OR link url OR first X characters of the message*

*count will shorten any text variants to specified length or, if empty, max that discord allows

@MarcusOtter
Copy link
Owner Author

While it would be nice for programmers I worry about the general public having to look up the available variables/options and entering free text. Would be nice to get some sort of dropdown list for this imo, even if it limits customization slightly.

@Madis0
Copy link

Madis0 commented Jan 15, 2022

How about this?
/configure autothreading channel:#channel default-title type:user-date value:$user (yyyy-MM-dd) for specific
/configure default-title type:first-characters value:10 for global

Types:

  • user-date
  • first-characters
  • link-title
  • link-url

value would depend on the type and be optional.

@ririko5834
Copy link

Good idea

@MarcusOtter MarcusOtter changed the title 馃挕 Improvement: Customize default title for auto-threads 馃挕 Customize default title for auto-threads Feb 6, 2022
@runloop
Copy link

runloop commented Feb 10, 2022

After having used Needle on my server this feature is definitely something that would beneficial. Particularly as I am using it auto-thread posts made by a bot. In my instance Link Title is definitely the most important option. I'm not sure I see the value in Link URL.

First characters is also a good option. Though a more suitable name would be prefix.

@maddie-wang
Copy link

My members want a user friendly title too! I want to use first line of message :)

Will use it ASAP when its released. Need it!

image

@CodeAnthem
Copy link

push - would love that

@distantnative
Copy link

That would be so great!

@Snailedlt

This comment was marked as off-topic.

@Snailedlt
Copy link

How about this?
/configure autothreading channel:#channel default-title type:user-date value:$user (yyyy-MM-dd) for specific
/configure default-title type:first-characters value:10 for global

Types:

  • user-date
  • first-characters
  • link-title
  • link-url

value would depend on the type and be optional.

I very much like this idea!

It works well both for customization and simplicity.

@MarcusOtter
Copy link
Owner Author

@Snailedlt
Button customization goes under issue #31

we could add a button for changing the title

This is the plan :)

Another option would be to prompt the user straight away for what they want the thread title to be, and then the first message they type after that prompt is set to the title.

I don't really like this UX, and Discord wants basically all intreactions to be through commands (not when users write messages, etc)

I do have a plan for implementing this. I just need to find the time...
I started working on something in PR #155 which is promising. It basically looks like this.

image

@Snailedlt
Copy link

@MarcusOtter ohh yes!
That modal feature would be great for titles . Especially if it can be opened by buttons

@MarcusOtter
Copy link
Owner Author

MarcusOtter commented Aug 24, 2022

Update on this: I added support for RegEx, message variables, and a custom max title length. Will be out with the next update (along with a LOT of other changes). Example of the feature:

image
image

Oh, and of course we provide options for people that don't want to write RegEx:
image

@DoNotResuscitate
Copy link

DoNotResuscitate commented Aug 29, 2022

How would this feature respond to the message being an embed? For example I'm thinking of using needle to auto create threads on my sesh.fyi posts. Would it be possible to pull the title value from an embed? @MarcusOtter

@MarcusOtter
Copy link
Owner Author

Excellent question @DooNotResuscitate, I had not tested it. Right now it doesn't work!

How do you suggest I implement support for this? My initial idea is to just append all embeds (title + description + fields + footer) for every embed. It might look messy but we can't really assume that an embed will always have the most important content in the description or in the fields, I think.

@DoNotResuscitate
Copy link

Excellent question @DooNotResuscitate, I had not tested it. Right now it doesn't work!

How do you suggest I implement support for this? My initial idea is to just append all embeds (title + description + fields + footer) for every embed. It might look messy but we can't really assume that an embed will always have the most important content in the description or in the fields, I think.

My personal suggestion would be to just pull the value from the title field - the Apollo bot (which has built-in thread creation) just uses the embed title for the thread title. It also includes the event time, but that's because it knows what date exactly to pull.

Screen Shot 2022-08-29 at 19 40 06

Screen Shot 2022-08-29 at 19 40 28

So for my purposes I would be content with just the embed title being pulled, but I'm wondering how it would be listed as an option like the others above. Maybe a separate parameter would need to be added for embeds specifically? Something like the already existing "title-format" and also "title-format-embed"? That way you could give a couple options specifically for if an embed is detected like: Title, Description, Title + Description, etc. @MarcusOtter

@MarcusOtter
Copy link
Owner Author

MarcusOtter commented Aug 29, 2022

This is not something I would make configurable, we should just pick a reasonable default to keep the amount of unnecessary options down. Since you will be able to regex on this anyways, I think I'll just do (title + \n\n + description + \n\n + field title + \n + field description + \n\n + footer) and then if you know you only want the title you can just target that with a regex.

The message content for the embed you showed would be ("..." for lazyness)

<@&XXXXXXXXXXXXXXXXXX>

DURF Weekly Game

Requirements: 18+, good mic and solid internet connection.
Players: 3-5 total
Desc...

Time
<t:1662296400:F> - <t:1662307200:t>
<:clock:XXXXX....

@DoNotResuscitate
Copy link

Yeah if the returned output can be regexed, then I think your default is just fine.

@DoNotResuscitate
Copy link

So with this implemented, would the plain default with no title-format option be the above if an embed is detected?

@MarcusOtter
Copy link
Owner Author

MarcusOtter commented Aug 30, 2022

The default would be the first 50 characters of the message, where the message in this case is the message content + embeds content. So if you have more than 50 characters in the message, you will never see the embed part (with the default settings).

@DoNotResuscitate
Copy link

Got it - so in the case of the message being just the embed by itself, would be first 50 chars of the embed. That works, and I assume the regex will parse over the whole entire message so I could pull whatever part out?

@MarcusOtter
Copy link
Owner Author

Yep!

@MarcusOtter
Copy link
Owner Author

Seems to work now, thanks for the comment. New lines are obviously not shown in thread titles but you could regex on them :) This is just grabbing the 100 first chars.

image
image

@MarcusOtter MarcusOtter unpinned this issue Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement 馃挕 Improvement suggestion
Projects
None yet
9 participants