-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmessage.py
46 lines (32 loc) · 1.07 KB
/
message.py
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
from moviesAPI import IMDBmovies
from musicAPI import spotify
from redditAPI import Reddit
from staticMessages import getMessage
async def resp(mess):
split_mess = mess.split()
response = getMessage(mess)
if response is not None:
return response
elif mess == "doge show memes":
reddit = Reddit()
url = await reddit.redditMemes()
return url
elif mess.startswith("doge movie"):
lenth = len(split_mess)
if lenth <= 2:
return "Name the movie please"
else:
movie_list = []
for i in range(2, lenth):
movie_list.append(split_mess[i])
movie_name = (" ".join(movie_list))
movie_search = IMDBmovies(movie_name)
return movie_search
elif mess.startswith("doge music latest"):
client = spotify()
return client.latest_albums()
elif mess.startswith("doge playlist"):
client = spotify()
return client.featured_playlists()
else:
return None