Fix tweet.py

This commit is contained in:
Klaus-Uwe Mitterer 2017-03-23 15:59:51 +01:00
parent 8fcfe72f5b
commit 0a8a69875c
1 changed files with 9 additions and 8 deletions

View File

@ -18,13 +18,14 @@ if __name__ == "__main__":
except KeyboardInterrupt:
exit(0)
if isinstance(args.reply, int):
reply = args.reply
else:
try:
if "twitter.com" in args.reply and "status" in args.reply:
reply = int(args.reply.split('/')[-1])
except:
raise ValueError("Invalid tweet ID passed for -r.")
if args.reply:
if isinstance(args.reply, int):
reply = args.reply
else:
try:
if "twitter.com" in args.reply and "status" in args.reply:
reply = int(args.reply.split('/')[-1])
except:
raise ValueError("Invalid tweet ID passed for -r.")
two.tweet(text, reply)