diff options
| author | 2019-10-08 14:21:15 +0100 | |
|---|---|---|
| committer | 2019-10-08 14:21:15 +0100 | |
| commit | 1b3ee1cb8982d460d7918c86122f3c3949d1df3d (patch) | |
| tree | 3f42f76f18b3aa3cc264ec087fdafbf3c8f7df39 /modules/tweets/format.py | |
| parent | allow !markovfor outside a channel when you share the channel with bitbot (diff) | |
| signature | ||
only show twitter url when one was not provided initially
Diffstat (limited to 'modules/tweets/format.py')
| -rw-r--r-- | modules/tweets/format.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/tweets/format.py b/modules/tweets/format.py index af6dfbbb..0a4926e4 100644 --- a/modules/tweets/format.py +++ b/modules/tweets/format.py @@ -6,7 +6,7 @@ def _timestamp(dt): since, unit = utils.time_unit(seconds_since) return "%s %s ago" % (since, unit) -def _tweet(exports, server, tweet): +def _tweet(exports, server, tweet, from_url): linked_id = tweet.id username = tweet.user.screen_name @@ -17,8 +17,10 @@ def _tweet(exports, server, tweet): tweet_link = "https://twitter.com/%s/status/%s" % (username, linked_id) - short_url = exports.get_one("shorturl")(server, tweet_link) - short_url = " - %s" % short_url if short_url else "" + short_url = "" + if not from_url: + short_url = exports.get_one("shorturl")(server, tweet_link) + short_url = " - %s" % short_url if short_url else "" created_at = _timestamp(tweet.created_at) # having to use hasattr here is nasty. |
