-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebhook.py
30 lines (25 loc) · 835 Bytes
/
webhook.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
def buildSendCommand(msg, username, avatar, detectThread, sendToThread, redirect, embeds=None, attachments=None):
baseCommand = "wh.send(msg, username=name"
if avatar == "*":
pass
else:
baseCommand = baseCommand + ", avatar_url=avtr"
if attachments == None:
pass
else:
baseCommand = baseCommand + ", files=fileAttachments"
if embeds == None:
pass
else:
baseCommand = baseCommand + ", embeds=embedList"
if detectThread == True and redirect == False:
baseCommand = baseCommand + ", thread=ctx.channel"
elif redirect == True:
if sendToThread == True:
baseCommand = baseCommand + ", thread=channel"
else:
pass
else:
pass
baseCommand = baseCommand + ", wait=True)"
return baseCommand