All Projects → markwragg → Powershell-SlackBot

markwragg / Powershell-SlackBot

Licence: other
Powershell based Slack Bot using the Real Time Messaging API and WebSockets.

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to Powershell-SlackBot

Jbot
Make Slack and Facebook Bots in Java.
Stars: ✭ 1,148 (+2700%)
Mutual labels:  slackbot, slack-bot
Fantasy football chat bot
GroupMe Discord and Slack Chatbot for ESPN Fantasy Football
Stars: ✭ 166 (+304.88%)
Mutual labels:  slackbot, slack-bot
Slack Machine
A sexy, simple, yet powerful and extendable Slack bot
Stars: ✭ 91 (+121.95%)
Mutual labels:  slackbot, slack-bot
Wc2018 Slack Bot
World Cup 2018 Slack Bot
Stars: ✭ 11 (-73.17%)
Mutual labels:  slackbot, slack-bot
Awesome Bots
The most awesome list about bots ⭐️🤖
Stars: ✭ 2,864 (+6885.37%)
Mutual labels:  slackbot, slack-bot
Slack Ruby Client
A Ruby and command-line client for the Slack Web, Real Time Messaging and Event APIs.
Stars: ✭ 957 (+2234.15%)
Mutual labels:  slackbot, slack-bot
Slack Block Builder
Lightweight, no-dependency JavaScript library for creating Slack Block Kit UIs, with a builder syntax, inspired by SwiftUI.
Stars: ✭ 129 (+214.63%)
Mutual labels:  slackbot, slack-bot
fplbot
🤖 Chatbot for Fantasy Premier League (Slack/Discord)
Stars: ✭ 14 (-65.85%)
Mutual labels:  slackbot, slack-bot
Sactive Bot
😈 An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
Stars: ✭ 212 (+417.07%)
Mutual labels:  slackbot, slack-bot
Go Sarah
Simple yet customizable bot framework written in Go.
Stars: ✭ 188 (+358.54%)
Mutual labels:  slackbot, slack-bot
Scrape Rss Bot
Slack bot that converts links to an RSS feed
Stars: ✭ 16 (-60.98%)
Mutual labels:  slackbot, slack-bot
slack-metabot
Extract metadata (EXIF) from uploaded files on Slack
Stars: ✭ 15 (-63.41%)
Mutual labels:  slackbot, slack-bot
Slacker
Slack Bot Framework
Stars: ✭ 495 (+1107.32%)
Mutual labels:  slackbot, slack-bot
Obed Bot
🍴 Obed Slack Bot, na požiadanie kontroluje aktuálnu ponuku denného menu reštaurácii. [only for slovak|czech users]
Stars: ✭ 32 (-21.95%)
Mutual labels:  slackbot, slack-bot
Threat-Intel-Slack-Bot
Interactive Threat Intelligence Bot that leverages serverless framework, AWS/GCP, and Slack
Stars: ✭ 26 (-36.59%)
Mutual labels:  slackbot, slack-bot
Botonomous
A PHP Framework For Creating Autonomous Slack Bots
Stars: ✭ 109 (+165.85%)
Mutual labels:  slackbot, slack-bot
SlackWebhooksGithubCrawler
Search for Slack Webhooks token publicly exposed on Github
Stars: ✭ 21 (-48.78%)
Mutual labels:  slackbot, slack-bot
iou-slack-bot
💸 IOU Slack Bot - Keep track of your debts with your peers.
Stars: ✭ 13 (-68.29%)
Mutual labels:  slackbot, slack-bot
Chatskills
Run and debug Alexa skills on the command-line. Create bots. Run them in Slack. Run them anywhere!
Stars: ✭ 171 (+317.07%)
Mutual labels:  slackbot, slack-bot
walkiebot
walkiebot opensource
Stars: ✭ 42 (+2.44%)
Mutual labels:  slackbot, slack-bot

Powershell-SlackBot

Build Status Test Coverage

This project is a PowerShell implementation of a Chat Bot for Slack that utilises the Slack Real Time Messaging (RTM) API. This code is intended to provide a simple framework for anyone that wants to write a Chat Bot for a single Slack Team that is able to respond to Channel and Direct Messages. It would also be simple to extend the code to permit the Bot to respond to any other events exposed via the RTM API.

For more information about how and why this Bot was authored, see my blog post here: http://wragg.io/powershell-slack-bot-using-the-real-time-messaging-api/

Requirements

This script uses the .NET class: System.Net.WebSockets.WebSocket. As such the code has to be run on Windows 8 / Server 2012 or newer operating systems.

Getting Started

If you haven't already, you first need to log in to your Slack account and create a Bot under Custom Integrations > Bots. You then need the API token of your Bot which can be passed to Invoke-SlackBot as a paramater or read from an XML file created via $Token | Export-CliXML.

This module is published in the Gallery so if you are running PowerShell 5, you can install the SlackBot module from the PowerShell Gallery via:

Install-Module -Name SlackBot

Alternatively download/clone the module folder from this repo on to server/computer running Win 8 or 2012 or above and that has internet connectivity to the Slack API. Copy the module to your modules directory and then load it with:

Import-Module SlackBot

Then start the Bot by executing:

Invoke-SlackBot -token "yourtoken"

The bot will generate a log file by default in your User Profile directory (C:\Users\youruser) under \Logs, and all log messages will also appear in the console as either PowerShell standard Verbose, Warning or Error output.

The bot is currently configured to respond to any Direct Messages, or any conversation that includes @botname (whatever you named your Bot) as any word of the message.

Extending the script

There are two obvious places to extend the script:

  1. Add additional conditions in the Switch($words) statement and any code that you want executed when those conditions are matched. Currently it splits the message in to an Array of $words, you may want to instead match the full .text response of the message.

  2. Add additional conditions in the Switch($RTM) statement to match other RTM API events. See the RTM API documentation for a full list of events: https://api.slack.com/rtm

Contributions

I welcome contributions to this project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].