sc-common-interface 2.3.9__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/PKG-INFO +1 -1
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/LiveCommonInterface.py +5 -3
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/setup.py +1 -1
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/McCommonInterface.py +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/Platform.py +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/__init__.py +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/setup.cfg +0 -0
{sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -134,7 +134,7 @@ def send_mc_message(data):
|
|
|
134
134
|
type = "commment"
|
|
135
135
|
payload = "{}"
|
|
136
136
|
if "payload" in data:
|
|
137
|
-
payload =
|
|
137
|
+
payload = data["payload"]
|
|
138
138
|
if "type" in data:
|
|
139
139
|
type = data["type"]
|
|
140
140
|
if "user_id" in data:
|
|
@@ -173,13 +173,15 @@ def send_mc_message(data):
|
|
|
173
173
|
body={"object":"instagram","entry":[{"time":stamp,"id":"%s"%page_id,"messaging":[{"sender":{"id":"%s"%user_id},"recipient":{"id":"%s"%page_id},
|
|
174
174
|
"timestamp":stamp,"message":{"mid":"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDUwMzgwODgwNTMzOjM0MDI4MjM2Njg0MTcxMDMwMTI0NDI3NjAyNDExMzcwMDc2NTA5MDozMTgzODU0Mzg3NTY4MDYwMTE3ODUxOTE2MD%d"%stamp,"text":"%s"%message}}]}]}
|
|
175
175
|
elif type=="postback" and platform.upper() in ("FB_GROUP","FACEBOOK"):
|
|
176
|
-
t_time = stamp * 1000
|
|
177
|
-
body = {"object":"page","entry":[{"time":
|
|
176
|
+
# t_time = stamp * 1000
|
|
177
|
+
body = {"object":"page","entry":[{"time":stamp,"id":"%s"%page_id,"messaging":[{"sender":{"id":"%s"%user_id},"recipient":{"id":"%s"%page_id},"timestamp":stamp,"postback":{"title":"继续 ➡️","payload":payload,"mid":"m_w6KNGd0PMndK0LvCw7Hzy1zsVSWT0fpN3ievQ9LtB0NxnnTQGDMyKI5DFeVbaJIRni1cqqJYXIJ-wq98aw%d"%stamp}}]}]}
|
|
178
178
|
url = "%s/facebook/webhook" % env
|
|
179
179
|
sign_text = hmac.new(key.encode("utf-8"), json.dumps(body).encode("utf-8"), sha1)
|
|
180
180
|
signData = sign_text.hexdigest()
|
|
181
181
|
header = {"Content-Type": "application/json", "x-hub-signature": "sha1=%s" % signData}
|
|
182
182
|
response = requests.post(url, headers=header, data=json.dumps(body))
|
|
183
|
+
# print(response.text)
|
|
184
|
+
print(body)
|
|
183
185
|
return user_id, name
|
|
184
186
|
|
|
185
187
|
|
{sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc-common-interface-2.3.9 → sc-common-interface-2.4.0}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|