-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcvbot.py
More file actions
67 lines (51 loc) · 1.71 KB
/
cvbot.py
File metadata and controls
67 lines (51 loc) · 1.71 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
56
57
58
59
60
61
62
63
64
65
66
67
import discord
import os
import httex2json,cvmaker
token = eval(open("secrets","r").read())
token=token["dckey"]
danger_list=['''"''',"'","\\"]
help='''CVBot Commands Start with a '&'
&help -> Show this help screen
&choices -> Select CV Template
'''
choicelist=["1.SimpleCV"]
client=discord.Client()
@client.event
async def on_ready():
print("Ready Steady po")
await client.change_presence(activity=discord.Game(name=" &help"))
@client.event
async def on_message(message):
secure_text=message.content
for danger in danger_list:
secure_text=secure_text.replace(danger,"")
if secure_text.startswith("&help"):
await message.channel.send(help)
if secure_text.startswith("&choices"):
b="".join(choicelist)
await message.channel.send(b)
if secure_text.startswith("&1") or secure_text.startswith("&SimpleCV") or secure_text.startswith("&1.SimpleCV"):
await message.channel.send("Send your Data in the following format : ")
await message.channel.send('''```&make1
<name>{Your Name}</name>
<email>{Your email}</email>
<exp>{experience heading}{experience details}</exp>
<exp>{experience heading}{experience details}</exp>
.
.
<edu>{education heading}{education details}</edu>
<edu>{education heading}{education details}</edu>
.
.
<pro>{project heading}{project details}</pro>
<pro>{project heading}{project details}</pro>
.
.
<link>{Facebook}{www.facebook.com/you}</link>
<link>{Twitter}{www.twitter.com/you}</link>```''')
if secure_text.startswith("&make1"):
print("$ Received job")
userdat=secure_text.replace("&make1","")
filename=cvmaker.template1(httex2json.httex2json(userdat))
await message.channel.send("Here is your cv 🤩📄",file=discord.File(filename))
client.run(token)