-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
589 additions
and
346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import json | ||
|
||
|
||
class FacebookMessage: | ||
def __init__(self, body): | ||
self.body = json.loads(body) | ||
if type(self.body) == str: | ||
self.body = json.loads(self.body) | ||
if type(self.body) == str: | ||
self.body = json.loads(self.body) | ||
|
||
def get_sender_id(self): | ||
sender_id = self.body["entry"][0]["messaging"][0]["sender"]["id"] | ||
return sender_id | ||
|
||
def get_text(self): | ||
text = self.body["entry"][0]["messaging"][0]["message"]["text"] | ||
return text | ||
|
||
def get_url(self): | ||
url = "" | ||
if len(url) < 1: | ||
raise AttributeError | ||
return url |
Oops, something went wrong.