this post was submitted on 22 Dec 2024
2 points (100.0% liked)

Perchance - Create a Random Text Generator

484 readers
6 users here now

⚄︎ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 2 years ago
MODERATORS
 

https://perchance.org/comments-plugin-oncomment-example Simple: Allow users to add a URL at the end of their nickname, which is hidden from their displayed nickname, but used as an avatar pic.

According to the tutorial, it is suggested to be simple. But because I am a newbie, I won't even able to do it after explained like I was five.

top 2 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 3 days ago (1 children)

Here is the modification of the example: https://perchance.org/gqp3r7gugk

On that one, you can see on Line 56 is where you can access the username of the person that sent the comment. My implementation is as follows:

  • We can specify a pattern that the users can follow so the code can parse the URL that is provided.
  • Since the nickname is only 50 characters long only, we can have them only specify the File ID of their avatar that is uploaded on the Perchance upload.
  • The file id is the random string before the file extension e.g. https://user-uploads.perchance.org/file/<file id>.<file extension> which is about 32 characters + 4-5 characters due to file extension and the dot (.webp, .png, .jpeg etc) so only 13 characters are left for the nickname (at the minimum).
  • The pattern is as follows: nickname|fileId.fileExtension so on the code we can split them to the file ID and the nickname.
  • On Line 61 is where we create an Image element and pass the file id to the URL formatting for accessing files in the upload.
  • On LIne 66, I just revamped the bubble format, so it is a little bit like the ai-character-chat message bubble.
  • We also prioritize the blue username, if available, over the provided nickname. So, if the person has a blue nickname, they can just pass through |fileID.fileExtension on the nickname.
[–] [email protected] 2 points 3 days ago

Thank you VioneT it looks decent!