this post was submitted on 29 Jan 2024
1 points (60.0% liked)

Perchance - Create a Random Text Generator

466 readers
13 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 1 year ago
MODERATORS
 

trying this: https://perchance.org/preprocessors

so i didn't get it to work and eventually did the simplest form but gives error.

i started with altering my name just to mess with stuff


$output(text) =>
  text.replaceAll("Allo","~allo~");
  return text;

(all the examples have the ; so maybe it needs em)

is all the preprocessor is.
and the importerizor is just:
$preprocess = {import:allopreprocess}

yet terrible error: TypeError: Cannot read properties of undefined (reading 'getSelf') at Object.get

i pretty much copypasted stuff and changed a few variables so i is the confuze as to how wrong

you are viewing a single comment's thread
view the rest of the comments
[–] VioneT 2 points 10 months ago (2 children)

I think it should be:

$output(text) =>
  text = text.replaceAll("Allo","~allo~");
  return text;

You need to set the text to the replaced text. See the Preprocessor page.

[–] Alllo 1 points 10 months ago (1 children)

interestingly i just, from the preprocessor page, imported the one shown, $preprocess = {import:inline-dent-preprocessor}

still gives the same error perhaps preprocessors in general are down? have not gotten a built in nor suggested one to not bug even when straight copypasting the import over

[–] VioneT 1 points 10 months ago (3 children)

I checked your code at https://perchance.org/allopreprocess, and it should be:

$output(text) =>
  text = text.replaceAll(":smile:", "😊");
  return text;

not

$preprocess(text) =>
  text = text.replaceAll(":smile:", "😊");
  return text;

It should always be an $output for the generator that is being imported.

[–] Alllo 2 points 10 months ago (1 children)

Ok I have figured it out I think. There initially was no actual problem. for some reason, initially upon adding a preprocessor, there is a mysterious error message that pops up any time it is run within the edit window. But do fullscreen and reload the page and the error message goes away and, interestingly, entering edit mode again the error doesn't come back.

can be seen easily by going here https://perchance.org/inline-dent-preprocessor then hitting edit, then hitting save. then see error message. that error message is what i was getting and was is apparently solved by going fullscreen and reloading page.

[–] VioneT 1 points 10 months ago

Yeah, I think it is because 'preprocessor' is applied before everything else. Which throws error upon first run, then the content is then cached/preloaded, which then resolves itself after.

[–] Alllo 1 points 10 months ago

that did nothing ty tho i tried it