-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbott.py
More file actions
55 lines (44 loc) · 1.62 KB
/
dbott.py
File metadata and controls
55 lines (44 loc) · 1.62 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
50
51
52
53
54
55
import discord
import os
import sys
import prices
import pred
import pred2
client = discord.Client()
TOKEN = 'NzAzNTg4NzM1MjQ1MjIxOTM5.XqQyEg.XE1WBYy1IGsV71qVcJeMC4A4wks'
lish = 'BTTC','ETH'
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hi'):
await message.channel.send('Hello')
if message.content.startswith('$mylist'):
lisht = message.content.replace("$mylist","")
lishtn = lisht.split(",")
lishtn.extend(lish)
await message.channel.send(lishtn)
if message.content.startswith('$price '):
nm = message.content.replace("$price ","")
nml = nm.split(" ")
prc = prices.price_yf(nml[0], nml[1], nml[2])
await message.channel.send(file=discord.File('dbot/dbimages/fig1.png'))
#await message.channel.send(prc)
if message.content.startswith('$predprice '):
nm = message.content.replace("$predprice ","")
nml = nm.split(" ")
name = nml[0]+"-INR"
prc = str(pred2.predd2(nml[0], "INR"))
#await message.channel.send("Model accuracy graph for "+nml[0]+": ")
await message.channel.send(prc)
if message.content.startswith('$predprice1 '):
nm = message.content.replace("$predprice1 ","")
nml = nm.split(" ")
name = nml[0]+"-INR"
prc = pred.predd(name,"2016-01-01")
#await message.channel.send("Model accuracy graph for "+nml[0]+": ")
await message.channel.send(prc)
client.run(TOKEN)