Addeded response to twitter task, prefixed the prefix

This commit is contained in:
Oliver Marks 2018-05-16 20:21:05 +01:00
parent ec4a347c96
commit dfc48073f5
1 changed files with 2 additions and 1 deletions

View File

@ -75,9 +75,10 @@ def twitter_message(message, prefix=''):
access_token_key=settings.TWITTER_ACCESS_TOKEN, access_token_key=settings.TWITTER_ACCESS_TOKEN,
access_token_secret=settings.TWITTER_ACCESS_SECRET) access_token_secret=settings.TWITTER_ACCESS_SECRET)
try: try:
status = api.PostUpdate(message) status = api.PostUpdate(prefix + message)
return {'result', 'Twitter message sent successfully'} return {'result', 'Twitter message sent successfully'}
except UnicodeDecodeError: except UnicodeDecodeError:
return {'result', "Your message could not be encoded. " return {'result', "Your message could not be encoded. "
"Perhaps it contains non-ASCII characters? " "Perhaps it contains non-ASCII characters? "
"Try explicitly specifying the encoding with the --encoding flag"} "Try explicitly specifying the encoding with the --encoding flag"}
return {'result': 'Twitter message sent successfully'}