Comments-plugin

Link to Pluginhttps://perchance.org/comments-plugin

This plugin allows you to embed a comments/feedback section on your generator's page. This plugin can be useful for getting feedback from visitors, social communities, etc. Just paste this in your Perchance code panel: **commentsPlugin = {import:comments-plugin}** and put this in your HTML panel: **[commentsPlugin(commentOptions)]** and it'll output a comment box. You can specify some options by writing this in your Perchance code panel:

```
commentOptions
	width = 300
	height = 350
	commentPlaceholderText = Add a friendly comment.
	submitButtonText = submit comment

```

You can set the width to 100% to make it take up the width of the screen (or container):

```
commentOptions
	width = 100%

```

You can also hide the comments so there's just the textarea and the button. In the example below we do that, and also set the height to 80 pixels:

```
commentOptions
	hideComments = true
	height = 80

```

If you'd like to display the most recent comments at the top:

```
commentOptions
	newestCommentsAtTop = true

```

If you want multiple different comment boxes in a single generator, use the `channel` option:

```
generalChatOptions
	channel = general-chat
  ...

feedbackOptions
	channel = feedback

```

#### Moderation

You can highlight your "admin" comments and delete other comments by adding this line:

```
commentOptions
	adminPasswordHash = REPLACE THIS TEXT WITH YOUR HASH

```

The "hash" is kind of like an "encrypted" version of your password. You can generate a password and its associated hash by clicking the "generate" button below. It's okay for other people to see your hash, but obviously make sure you don't put your password anywhere in your generator's code.

*The hash generator is only on the perchance page.*

Now, to make an admin comment, just click on your comments plugin embed, then press `Ctrl`+`L` (or `Cmd`+`L` on Mac). The "L" stands for "login". It'll show you an input to add your password. Then you'll see a little crown emoji and all comments that you make after that will be marked as admin comments

You can change your password at any time by using this page to generate a new hash, and then replacing the old hash with the newly generated one. **But** note that if you do that, you old admin comments won't be "highlighted" anymore, and you'll have to re-delete comments that you previously deleted. You've essentially created a new "admin" account for your comments section, so the old admin's actions aren't counted as coming from an admin anymore.
By default the your "admin flair" will show up as "`👑 MOD`" and the delete button on each comment will be a trash emoji. But you can change both of these:

```
commentOptions
	adminFlair = 💎OWNER💎
  deleteButtonIcon = ❌

```

#### **Notes:**

* There is a default banned-words list that tries to cover racial slurs, homophobia, slut-shaming, etc. but it doesn't cover general swear words and profanity. If you see any derogatory terms getting through the default filter then please report them on the forum.
* Please don't rely on the comments for important stuff. The comments may get deleted every now and then, so they should be thought of as "transient" communication rather than a log of important information.
* You can hide all comments that occurred before a specific date with `hideCommentsBeforeDate = 28 August 2019`. Make sure you don't add "th" after the number. I.e. write "28" and *not* "28th".
* Please note that if you embed this in your generator, anyone on the internet can comment, and so you may get trolls and terrible people posting bad comments.
* You can use regex patterns in your bannedWords list. Just wrap the pattern in slashes like this: `/your.*pattern/`. At this point you can't use commas within your regex though.
* **You can now make slash commands!**