mirror of
https://github.com/ihabunek/toot.git
synced 2024-12-04 14:46:33 -05:00
parent
92d4dc745a
commit
fde6bd6125
@ -74,8 +74,15 @@ def post(app, user, args):
|
||||
media = _do_upload(app, user, args.media)
|
||||
media_ids = [media['id']]
|
||||
else:
|
||||
media = None
|
||||
media_ids = None
|
||||
|
||||
if media and not args.text:
|
||||
args.text = media['text_url']
|
||||
|
||||
if not args.text:
|
||||
raise ConsoleError("You must specify either text or media to post.")
|
||||
|
||||
response = api.post_status(app, user, args.text, args.visibility, media_ids)
|
||||
|
||||
print_out("Toot posted: <green>{}</green>".format(response.get('url')))
|
||||
|
@ -144,6 +144,7 @@ POST_COMMANDS = [
|
||||
arguments=[
|
||||
(["text"], {
|
||||
"help": "The status text to post.",
|
||||
"nargs": "?",
|
||||
}),
|
||||
(["-m", "--media"], {
|
||||
"type": FileType('rb'),
|
||||
|
Loading…
Reference in New Issue
Block a user