Avoid exactly reposting old messages.

npm audit
This commit is contained in:
Charlie Laabs
2022-01-12 18:41:36 -06:00
parent b7597b57a6
commit 46092e3274
4 changed files with 16 additions and 10 deletions

View File

@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
## Versions ## Versions
### 2.0.1
* Add a filter to ensure the bot doesn't just post exact previous messages.
### 2.0.0 ### 2.0.0
#### Breaking Changes #### Breaking Changes

16
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "markov-discord", "name": "markov-discord",
"version": "2.0.0", "version": "2.0.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "markov-discord", "name": "markov-discord",
"version": "2.0.0", "version": "2.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@discordjs/builders": "^0.11.0", "@discordjs/builders": "^0.11.0",
@@ -2593,9 +2593,9 @@
"dev": true "dev": true
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.14.6", "version": "1.14.7",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz",
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==", "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -7935,9 +7935,9 @@
"dev": true "dev": true
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.14.6", "version": "1.14.7",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz",
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==", "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==",
"dev": true "dev": true
}, },
"form-data": { "form-data": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "markov-discord", "name": "markov-discord",
"version": "2.0.0", "version": "2.0.1",
"description": "A conversational Markov chain bot for Discord", "description": "A conversational Markov chain bot for Discord",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {

View File

@@ -60,7 +60,9 @@ const markovOpts: MarkovConstructorOptions = {
const markovGenerateOptions: MarkovGenerateOptions<MarkovDataCustom> = { const markovGenerateOptions: MarkovGenerateOptions<MarkovDataCustom> = {
filter: (result): boolean => { filter: (result): boolean => {
return result.score >= config.minScore; return (
result.score >= config.minScore && !result.refs.some((ref) => ref.string === result.string)
);
}, },
maxTries: config.maxTries, maxTries: config.maxTries,
}; };