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
|
||||
|
||||
#### Requirements
|
||||
#### Windows Requirements
|
||||
|
||||
* [Node.js 12.0+ (Current)](https://nodejs.org/en/download/)
|
||||
* Installing with build tools is recommended
|
||||
|
||||
#### Setup
|
||||
#### Windows Setup
|
||||
|
||||
1. Install Node.js 12.0 or newer.
|
||||
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
|
||||
|
||||
#### Requirements
|
||||
#### Debian Requirements
|
||||
|
||||
* Node.js 12.0+
|
||||
* Python 2.7 (for erlpack)
|
||||
@@ -142,6 +142,10 @@ npm start
|
||||
|
||||
## Changelog
|
||||
|
||||
### 0.7.2
|
||||
|
||||
* Fix @everyone replacement
|
||||
|
||||
### 0.7.1
|
||||
|
||||
* Readme updates
|
||||
@@ -201,6 +205,6 @@ npm start
|
||||
|
||||
* 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.
|
||||
|
||||
7
index.ts
7
index.ts
@@ -272,8 +272,7 @@ function generateResponse(message: Discord.Message, debug = false, tts = message
|
||||
fsMarkov.endWords = markovFile.endWords;
|
||||
|
||||
try {
|
||||
const result = fsMarkov.generate(options);
|
||||
const myResult = result as MarkbotMarkovResult;
|
||||
const myResult = fsMarkov.generate(options) as MarkbotMarkovResult;
|
||||
console.log('Generated Result:', myResult);
|
||||
const messageOpts: Discord.MessageOptions = { tts };
|
||||
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'
|
||||
message.channel.send(result.string, messageOpts);
|
||||
myResult.string = myResult.string.replace(/@everyone/g, '@everyοne'); // Replace @everyone with a homoglyph 'o'
|
||||
message.channel.send(myResult.string, messageOpts);
|
||||
if (debug) message.channel.send(`\`\`\`\n${JSON.stringify(myResult, null, 2)}\n\`\`\``);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "markbot",
|
||||
"version": "0.7.1",
|
||||
"version": "0.7.2",
|
||||
"description": "A conversational Markov chain bot for Discord",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user