-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add markov chain text generation for arm32
It isn't very good x86/64 builds are broken now since the Dockerfile needs updates
- Loading branch information
1 parent
ed34da2
commit e217bf0
Showing
4 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from markovchain.text import MarkovText, ReplyMode | ||
|
||
markov = MarkovText() | ||
|
||
with open('markov.txt') as fp: | ||
markov.data(fp.read()) | ||
|
||
def reply(input=''): | ||
return markov(reply_to=input, reply_mode=ReplyMode.END) | ||
|
||
cmd = '$mk ' | ||
|
||
async def on_message(message): | ||
if message.content.startswith(cmd): | ||
prefix = message.content[len(cmd):] | ||
await message.channel.send(reply(prefix)) |