-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
23 lines (19 loc) · 859 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import discord
from markov_generator import MarkovGenerator
client = discord.Client()
@client.event
async def on_message(message):
if '{}, what do you see'.format(client.user.name) in message.content.lower():
chat_log_text = ''
async for msg in client.logs_from(message.channel, limit = 500):
if not msg.author.bot and '{}, what do you see'.format(client.user.name) not in msg.content.lower(): #ignores bots and messages with the activation phrase
chat_log_text += '{}\n'.format(msg.content)
markgen = MarkovGenerator(chat_log_text)
await client.send_message(message.channel, markgen.create_markov_chain_text(100))
@client.event
async def on_ready():
print('Logged in as:')
print(client.user.name)
print(client.user.id)
print('-------------')
client.run('insert_token_here')