This slack bot is designed to say hello to new Screeps Slack users. It uses BotKit and the Slack Real Time Messaging API to greet new users in the #general
channel, and send them a hello message including Do's, Do Not's, helpful links and a list of moderators in a direct message.
It is designed to be a configuration under the Bots app custom integration.
- dotenv (v4.0.0 or higher)
- botkit (v0.6.5 or higher)
- Add the Bots slack app to your workspace
- Click on the Bots app under Custom Integrations
- Create or open a configuration for the WelcomeBot
- Edit the
Name
,Icon
andFull Name
values in the configuration. - Copy the
xoxb-
token after the installation process is complete
- Get the code
- Clone this repo and run
npm install
- If you edit this for another slack, you will need to edit your message in message.js.
- Clone this repo and run
- Set values in
.env
(copy.env.sample
):SCOPE
: Do not edit this entry. These are the required permissions to operate.TOKEN
: Your bot'sxoxb-
token (available on the edit configuration page)ID
: Your bot'sName
(available on the edit configuration page)PORT
: The port that you want to run the web server onGENERAL
: the ID of your#general
channel. You may have to download an export to retrieve your#general
channel's ID. (defaults to Screeps slack's#general
channel)
- Start the app (
npm start
)
- On a
team_join
event, the bot will greet the new user in #general - On a
team_join
event, the bot will send a message to the new user in a DM - Any user can receive the message by saying anything to the bot in DM
The bot will show a log of all the RTM actions, based off of the default logging in BotKit.
U:\profile\Documents\GitHub\ScreepsWelcomeBot>npm start
> ScreepsWelcomeBot@1.0.0 start U:\profile\Documents\GitHub\ScreepsWelcomeBot
> node src/bot.js
Initializing Botkit v0.6.5
info: ** No persistent storage method specified! Data may be lost when process shuts down.
info: ** API CALL: https://slack.com/api/rtm.connect
notice: ** BOT ID: welcome_bot ...attempting to connect to RTM!
notice: RTM websocket opened
info: ** API CALL: https://slack.com/api/chat.postMessage
info: ** API CALL: https://slack.com/api/im.open
info: [Start] 0 Task for U7UUSDW2V in D7VCBH13M
info: > [Start] 0 Conversation with U7UUSDW2V in D7VCBH13M
info: ** API CALL: https://slack.com/api/chat.postMessage
info: > [End] 0 Conversation with U7UUSDW2V in D7VCBH13M
info: [End] 0 Task for U7UUSDW2V in D7VCBH13M