Add the /tweet
command to your Slack workspace.
It runs on Cloudflare Workers, so there is no cold starts.
/tweet message
Tweet your message. The message will be posted correctly even if it contains line breaks or URLs.
or
$ git clone https://github.com/ahuglajbclajep/slack-tweet-command.git .
$ yarn
$ npx wrangler login
$ npx wrangler whoami
# enter the Account ID in the account_id field of wrangler.toml
$ yarn deploy
Authentication is required to tweet from third party clients.
- Apply for a developer account from here
- Create an app
- Note down API Key, API Secret, Access Token and Access Secret
Go to the your Slack apps page.
- Create New App
- Development Slack Workspace: select a workspace you want to install this app
- Create New Slash Command
- Request URL: your Worker's URL
- Note down Signing Secret
$ npx wrangler secret put SLACK_SIGNING_SECRET # enter the Slack Signing Secret
$ npx wrangler secret put TWITTER_CONSUMER_KEY # enter the Twitter API Key
$ npx wrangler secret put TWITTER_CONSUMER_SECRET # enter the Twitter API Secret
$ npx wrangler secret put TWITTER_ACCESS_TOKEN # enter the Twitter Access Token
$ npx wrangler secret put TWITTER_ACCESS_SECRET # enter the Twitter Access Secret