def tweet(ctx, created_at, twtfile, text): """Append a new tweet to your twtxt file.""" tweet = Tweet(text, created_at) if created_at else Tweet(text) if not add_local_tweet(tweet, twtfile): click.echo("✗ Couldn’t write to file.") else: hook = ctx.obj["conf"].post_tweet_hook if hook: run_post_tweet_hook(hook, ctx.obj["conf"].options)
def tweet(ctx, created_at, twtfile, text): """Append a new tweet to your twtxt file.""" text = expand_mentions(text) tweet = Tweet(text, created_at) if created_at else Tweet(text) pre_tweet_hook = ctx.obj["conf"].pre_tweet_hook if pre_tweet_hook: if not run_pre_tweet_hook(pre_tweet_hook, ctx.obj["conf"].options): click.echo("✗ pre_tweet_hook returned non-zero") raise click.Abort if not add_local_tweet(tweet, twtfile): click.echo("✗ Couldn’t write to file.") else: post_tweet_hook = ctx.obj["conf"].post_tweet_hook if post_tweet_hook: run_post_tweet_hook(post_tweet_hook, ctx.obj["conf"].options)