-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfran_code
More file actions
50 lines (40 loc) · 1.55 KB
/
fran_code
File metadata and controls
50 lines (40 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# download neuralintents and from nltk | corpora omw-1.4
import discord
import random
import datetime
from neuralintents import GenericAssistant
import nltk
# Global variables
client = discord.Client()
start_time = datetime.datetime.utcnow()
#ChatAI setup (not implemented yet)
#chatAI = GenericAssistant('intents.json')
#chatAI.train_model()
#chatAI.save_model()
@client.event
async def on_ready():
print('Now logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
global start_time
response_time = datetime.datetime.utcnow()
if message.author == client.user:
return
# this is the one which utilises GenericAssistant, so it won't be applicable until later.
# if message.content.startswith('qFran: '):
# response = chatAI.request(message.content[7:])
# await message.channel.send(response)
if message.content == 'Fran Test':
now = datetime.datetime.utcnow()
await message.channel.send('All systems nominal.')
await message.channel.send(now - response_time)
if message.content == 'dmFran':
await message.author.send("This is the start of a direct message conversation.")
if message.content == 'rNumber':
rnumber = random.randint(1, 101)
await message.channel.send(rnumber)
if message.content == 'programRuntime':
current_time = datetime.datetime.utcnow()
program_runtime = current_time - start_time
await message.channel.send("Fran has been active for: ")
await message.channel.send(program_runtime)