parent
92d4dc745a
commit
fde6bd6125
2 changed files with 8 additions and 0 deletions
|
@ -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 a new issue