All Projects → techgaun → Ex_mustang

techgaun / Ex_mustang

Licence: apache-2.0
✨ A simple, clueless bot

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Ex mustang

Marvin
The paranoid bot (framework)
Stars: ✭ 51 (-23.88%)
Mutual labels:  bot, slack-bot, slack
Jbot
Make Slack and Facebook Bots in Java.
Stars: ✭ 1,148 (+1613.43%)
Mutual labels:  bot, slack-bot, slack
Slick
Slick, a Slack bot in Go
Stars: ✭ 150 (+123.88%)
Mutual labels:  bot, slack-bot, slack
Slack Machine
A sexy, simple, yet powerful and extendable Slack bot
Stars: ✭ 91 (+35.82%)
Mutual labels:  bot, slack-bot, slack
Hubcommander
A Slack bot for GitHub organization management -- and other things too
Stars: ✭ 1,149 (+1614.93%)
Mutual labels:  bot, slack-bot, slack
Norrisbot
a Slack bot that kicks asses (roundhouse-kicks to be accurate...)
Stars: ✭ 134 (+100%)
Mutual labels:  bot, slack-bot, slack
Go Sarah
Simple yet customizable bot framework written in Go.
Stars: ✭ 188 (+180.6%)
Mutual labels:  bot, slack-bot, slack
Botonomous
A PHP Framework For Creating Autonomous Slack Bots
Stars: ✭ 109 (+62.69%)
Mutual labels:  bot, slack-bot, slack
Slacker
Slack Bot Framework
Stars: ✭ 495 (+638.81%)
Mutual labels:  bot, slack-bot, slack
Intelligo
🤖 Chatbot Framework for Node.js.
Stars: ✭ 347 (+417.91%)
Mutual labels:  bot, slack-bot, slack
Slacky
🐍 The BEST Slack Selfbot on GitHub | No Bot User, Acts Like It's You! ⭐️
Stars: ✭ 80 (+19.4%)
Mutual labels:  bot, slack-bot, slack
Busy Beaver
The Chicago Python Community Engagement Slack bot
Stars: ✭ 66 (-1.49%)
Mutual labels:  slack-bot, hacktoberfest, slack
Php Slack Bot
Slack bot user written in PHP
Stars: ✭ 161 (+140.3%)
Mutual labels:  bot, slack-bot, slack
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 (+216.42%)
Mutual labels:  bot, slack-bot, slack
Notify
A dead simple Go library for sending notifications to various messaging services.
Stars: ✭ 727 (+985.07%)
Mutual labels:  bot, hacktoberfest, slack
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 (-52.24%)
Mutual labels:  bot, slack-bot, slack
Slack Poster
Simple gem to post messages on Slack using web hooks.
Stars: ✭ 49 (-26.87%)
Mutual labels:  bot, slack
Community Bot
The bot used on the TypeScript Community discord server
Stars: ✭ 46 (-31.34%)
Mutual labels:  bot, hacktoberfest
Emotecollector
Collects emotes from other servers for use by people who don't have Nitro
Stars: ✭ 51 (-23.88%)
Mutual labels:  bot, hacktoberfest
Reviewbot
Reviewbot is a Slack bot that shows reviewable pull requests.
Stars: ✭ 40 (-40.3%)
Mutual labels:  bot, slack-bot

ex_mustang

A simple, clueless bot

Mustang

ExMustang is a bot for Slack written in Elixir. While ExMustang is written for Slack, the responder modules should work fine with other Hedwig adapters as well. If you like Mustang, please use Mustang as bot image if possible :)

Warning: This is a work in progress.

Example

Example

Example

Setup

Create a Slack bot user from here. You will receive an API token you can use. Set the SLACK_API_TOKEN environment variable and you should be good to go.

You can run this bot as below:

export SLACK_API_TOKEN="<SLACK_API_TOKEN>"
mix run --no-halt

A sample runner configuration looks like below:

export SLACK_API_TOKEN="<SLACK_API_TOKEN<"
export GITHUB_TOKEN="<GITHUB_TOKEN>"
export GOOGLE_API_KEY="<GOOGLE_API_KEY>"
export GIPHY_API_KEY="<GIPHY_API_KEY>"
export STANDUP_CHANNEL="scrum"
export GH_CHANNEL="github"
export PWN_CHANNEL="critical"
export UPTIME_CHANNEL="critical"
export SLACK_INVITEALL_TOKEN="<SLACK_INVITEALL_TOKEN>"

mix run --no-halt

For using ex_mustang with multiple slack teams, you can use MIX_ENV by creating config files such as yourteam.exs and run as MIX_ENV=yourteam mix run --no-halt

Scheduled Notifications

Github Pull Requests Watcher

You can configure github token by setting GITHUB_TOKEN. Also, you can pass list of repos to watch by updating config. There are bunch of other stuffs you can configure such as schedule (which follows cron format), slack channel and thresholds.

Standup Reminder

The standup reminder reminds us when its standup time. Our nature is that we either forget track of time or are too lazy to remember about it. This does not make you better at attending standup but is more of a satire for us. You can configure message and other bunch of stuffs on config

Have I Been Pwned Checker

The hibp checker can check list of accounts against haveibeenpwned.com by using ExPwned. You can set the appropriate configuration on config.exs.

# config below runs hibp check once a day and posts if any found breach to configured slack channel
config :ex_mustang, ExMustang.Responders.Pwned,
  schedule: "0 * */1 * *",
  enabled: true,
  accounts: [
    "[email protected]",
    "[email protected]"
  ],
  slack_channel: System.get_env("PWN_CHANNEL") || "general"

Uptime Monitoring

ExMustang supports simple uptime monitoring and can perform periodic uptime checks against given set of endpoints. The config block looks like below:

config :ex_mustang, ExMustang.Responders.Uptime,
  schedule: "*/5 * * *",
  enabled: true,
  endpoints: [
    [
      uri: "https://api.brighterlink.io/status", status_code: 200, content: ~s("msg":"ok"), method: "GET",
      content_type: "application/json", req_headers: [{"User-Agent", "ExMustang"}], timeout: 20_000
    ]
  ],
  slack_channel: System.get_env("UPTIME_CHANNEL") || "general"

The endpoints section is where you define the endpoints you're willing to perform uptime check against.

  • uri - the endpoint to hit
  • status_code - expected status code
  • content - expected response body content (supports both string and regular expression)
  • method - one of GET, POST, PUT, PATCH and DELETE
  • body - body to send as part of POST, PUT or PATCH requests
  • content_type - expected content type header value
  • req_headers - list of tuples of request headers to send
  • timeout - maximum timeout before request fails

Random Quote of the Day

ExMustang can send a quote as specified in schedule. You can configure schedule from config.exs and you can specify QUOTE_CHANNEL env-var. If QUOTE_CHANNEL is not specified, the quotes are sent to general channel by default.

Responders

Currently, there are following responders and these should ideally work with any Hedwig adapters:

  • ExMustang.Responders.GMap - gives you google maps search result for your search queries.
  • ExMustang.Responders.Pwned -
  • ExMustang.Responders.Quote - gives you random funny quote
  • ExMustang.Responders.Slap - slaps another user
  • ExMustang.Responders.Time - gives time on given timezone (without timezone, uses local timezone of machine ExMustang is running on)
  • ExMustang.Responders.TimeConvert - converts given unix timestamp to ISO8601 format
  • ExMustang.Responders.EncodeDecode - encoding/decoding tools
  • ExMustang.Responders.Isup - checks if a site is up or not via isitup.org API
  • ExMustang.Responders.RandomInsult - insults a user with random insults from randominsults.net
  • ExMustang.Responders.HTTPCat - gets a cat for corresponding http status code
  • ExMustang.Responders.Howdoi - tries to find answer for programming questions
  • ExMustang.Responders.CommitMsg - Get random commit messages from http://whatthecommit.com/index.txt
  • ExMustang.Responders.CLIFu - Gets clifu gems from http://www.commandlinefu.com
  • ExMustang.Responders.Whois - performs a whois query using https://dnsquery.org
  • ExMustang.Responders.GitTip - get a random git tip (with support for keywords)
  • ExMustang.Responders.Birthday - send a happy birthday to the mentioned user
  • ExMustang.Responders.InviteAll - invite all members (of optionally given channel)
  • ExMustang.Responders.UrbanDictionary - presents urban dictionary word of the day
  • ExMustang.Responders.Giphy - renders gif using https://giphy.com

For Google Maps search, you have to set GOOGLE_API_KEY which has access to call google places api.

mustang help - Displays all of the help commands that mustang knows about.
mustang help <query> - Displays all help commands that match <query>.
gmap <search_term> - Replies with the information from google places/maps.
pwned <search_account> - Checks to see if an account has been breached or not
quote - Replies with a random quote.
slap - Slaps the user. Format: slap <username> | me
time - get time in a given timezone
unix2iso <unix_timestamp> - Converts given unix timestamp to ISO format (Auto-replies for values that look like timestamps)
b64encode <content> - base64 encoding of given text content
b64decode <content> - base64 decoding of given text content
isitup <domain> - checks if given domain is up or not
insult me|<username> - insults given username with random insults
httpcat <status_code> - get http status code cat for given value
howdoi <query> - tries to find solution on the given query
commitmsg - get a random commit message
clifu [search_word] - get clifu gem (gives random clifu if no keyword is passed)
whois <domain> - gives whois query for given domain
gittip [keyword] - Get a random git tip for given keyword
happy birthday <me|@user> - Send happy birthday message to the user mentioned
hdeploy <app-name> - Deploys configured branch to the given app
inviteall [src_channel] - invite all the members of source channel
giphy [search_term] - Tries to find a GIF matching search_term (gives random gif if no search_term is provided)

Heroku Deployment

For heroku deployment to work, you need to specify the following configurations:

  • HEROKU_GITHUB_TOKEN or GITHUB_TOKEN
  • HEROKU_TOKEN which is an API key you can get from here
  • mapping of apps in your config which is a tuple of heroku app name and map of repo and branch

An example config looks like below:

config :ex_mustang, ExMustang.Responders.HerokuDeploy,
  github_token: System.get_env("HEROKU_GITHUB_TOKEN") || System.get_env("GITHUB_TOKEN"),
  token: System.get_env("HEROKU_TOKEN"),
  apps: [
    {"casa-core-stage", %{repo: "casaiq/core", branch: "master"}}
  ]

InviteAll Responder

The invite all responder requires you to provide a token of a non-bot and non-guest slack team member because thats how the slack api works. You can get your personal tokens from HERE

Changelog

The detail changelog is available HERE

About Mustang

Mustang (pronounced like moostang not like the Ford Mustang; I don't know phonetics) is my best friend whom I had to leave back in Nepal. After surviving April 2015 Earthquake, we lived together for a while and I had to leave him back in Nepal. Below is the pic post-earthquake.

Mustang and Me

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].