mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-20 03:01:04 -05:00
Update 0.7.2: Fix @everyone replacement
This commit is contained in:
12
README.md
12
README.md
@@ -17,12 +17,12 @@ First, create a [Discord bot application](https://discordapp.com/developers/appl
|
|||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
#### Requirements
|
#### Windows Requirements
|
||||||
|
|
||||||
* [Node.js 12.0+ (Current)](https://nodejs.org/en/download/)
|
* [Node.js 12.0+ (Current)](https://nodejs.org/en/download/)
|
||||||
* Installing with build tools is recommended
|
* Installing with build tools is recommended
|
||||||
|
|
||||||
#### Setup
|
#### Windows Setup
|
||||||
|
|
||||||
1. Install Node.js 12.0 or newer.
|
1. Install Node.js 12.0 or newer.
|
||||||
1. Download this repository using git in a command prompt
|
1. Download this repository using git in a command prompt
|
||||||
@@ -62,7 +62,7 @@ First, create a [Discord bot application](https://discordapp.com/developers/appl
|
|||||||
|
|
||||||
### Debian Linux
|
### Debian Linux
|
||||||
|
|
||||||
#### Requirements
|
#### Debian Requirements
|
||||||
|
|
||||||
* Node.js 12.0+
|
* Node.js 12.0+
|
||||||
* Python 2.7 (for erlpack)
|
* Python 2.7 (for erlpack)
|
||||||
@@ -142,6 +142,10 @@ npm start
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 0.7.2
|
||||||
|
|
||||||
|
* Fix @everyone replacement
|
||||||
|
|
||||||
### 0.7.1
|
### 0.7.1
|
||||||
|
|
||||||
* Readme updates
|
* Readme updates
|
||||||
@@ -201,6 +205,6 @@ npm start
|
|||||||
|
|
||||||
* Updated training algorithm and data structure.
|
* Updated training algorithm and data structure.
|
||||||
|
|
||||||
# Thanks
|
## Thanks
|
||||||
|
|
||||||
Thanks to [BotMaker-for-Discord](https://github.com/CorySanin/BotMaker-for-Discord) which I used as a reference when during development.
|
Thanks to [BotMaker-for-Discord](https://github.com/CorySanin/BotMaker-for-Discord) which I used as a reference when during development.
|
||||||
|
|||||||
7
index.ts
7
index.ts
@@ -272,8 +272,7 @@ function generateResponse(message: Discord.Message, debug = false, tts = message
|
|||||||
fsMarkov.endWords = markovFile.endWords;
|
fsMarkov.endWords = markovFile.endWords;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = fsMarkov.generate(options);
|
const myResult = fsMarkov.generate(options) as MarkbotMarkovResult;
|
||||||
const myResult = result as MarkbotMarkovResult;
|
|
||||||
console.log('Generated Result:', myResult);
|
console.log('Generated Result:', myResult);
|
||||||
const messageOpts: Discord.MessageOptions = { tts };
|
const messageOpts: Discord.MessageOptions = { tts };
|
||||||
const attachmentRefs = myResult.refs
|
const attachmentRefs = myResult.refs
|
||||||
@@ -289,8 +288,8 @@ function generateResponse(message: Discord.Message, debug = false, tts = message
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
myResult.string.replace(/@everyone/g, '@everyοne'); // Replace @everyone with a homoglyph 'o'
|
myResult.string = myResult.string.replace(/@everyone/g, '@everyοne'); // Replace @everyone with a homoglyph 'o'
|
||||||
message.channel.send(result.string, messageOpts);
|
message.channel.send(myResult.string, messageOpts);
|
||||||
if (debug) message.channel.send(`\`\`\`\n${JSON.stringify(myResult, null, 2)}\n\`\`\``);
|
if (debug) message.channel.send(`\`\`\`\n${JSON.stringify(myResult, null, 2)}\n\`\`\``);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "markbot",
|
"name": "markbot",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"description": "A conversational Markov chain bot for Discord",
|
"description": "A conversational Markov chain bot for Discord",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user