GithubHelp home page GithubHelp logo

awgh / marvin Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 6.0 13.91 MB

Marvin is a Slack and IRC bot, proving a mixed drinks database, hash cracking, answering machine, and Markov-chain functions. Designed for easy cloud deployment, configurable with JSON files.

Shell 1.51% Go 98.49%
irc irc-bot slack slack-bot drinks mixed-drink-database drink booze marvin recipe broadcast md5-decryptor

marvin's Introduction

marvin

IRC and Slack bot from Milliways

Instructions for Ubuntu 16.04

Install go

curl https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz > go1.9.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz

Add go to your environment/PATH

sudo echo -ne "export GOPATH=$HOME/go\nexport PATH=$PATH:/usr/local/go/bin" >> /etc/profile
source /etc/profile

Verify go is in your path

echo $PATH $GOPATH

Create go build directories

mkdir -p $HOME/go/src/

Download marvin

go get github.com/awgh/madns
cd $HOME/go/src

Install marvin

Replace /opt/marvin with the target directory of your choice.

cd $HOME/go/src
./install.sh /opt/marvin

Create Your JSON Config Files

In the /opt/marvin/config directory (or your custom target equivalent), create a JSON file for each chat backend you wish to connect to.

At this time, only ONE CONNECTION TO SLACK is supported, but multiple different IRC networks can be connected to at once, and you can connect to Slack at the same time as multiple IRC networks... but some features aren't completely working Slack<->IRC yet.

Example IRC config

Create a file in the config directory called "ANYTHING.json" and customize the following template with your own IRC information, proxy information (optional), and your free md5decrypt API credentials from md5decrypt https://md5decrypt.net/en/Api/ (optional).

{
        "Host":"irc.freenode.net",
        "Port":"6697",
        "Nick":"YOUR_NICK_HERE",
        "Password":"YOUR_PASSWORD_HERE",
        "Channel":"#ratnet",
        "Name":"YOUR_NAME_HERE",
        "Version":"IRCsome v1.0",
        "Quit":"bye!",
        
        "ProxyEnabled":false,
        "Proxy":"socks5://PROXY_USER:PROXY_PASSWORD@PROXY_HOST:1080",
        
        "MD5ApiUser":"YOUR_MD5_API_USER",
        "MD5ApiCode":"YOUR_MD5_API_KEY"
}

Example Slack config

Create a file in the config directory called "slack.json" (really anything with a .json extension) and customize the following template with your own Slack information and your free md5decrypt API credentials from md5decrypt https://md5decrypt.net/en/Api/ (optional).

{
        "SlackAPIToken":"xorx-YOUR-SLACK-APP-API-TOKEN-HERE",
        "SlackChannel":"SLACK_CHANNEL_ID",
        
        "MD5ApiUser":"YOUR_MD5_API_USER",
        "MD5ApiCode":"YOUR_MD5_API_KEY"
}

In order to get a Slack API token, follow the instructions to create a Marvin App for your workspace here: https://api.slack.com/apps/new

It doesn't need any special permissions, and you can name it whatever you want. You'll mostly just click through.

You will also need to create and manage Bot Users here: https://api.slack.com/bot-users

When that is complete, under the "OAuth & Permissions" tab, you will find the "Bot User OAuth Access Token". This is the token you will use for the "SlackAPIToken" value in your Slack JSON config file.

The channel ID has to be the funky Slack channel ID string, not the human-readable channel name. You can get this from logging into your workspace in the web browser, clicking on the target channel and looking in the URL bar, where you'll see something like this:

https://myworkspace.slack.com/messages/YOUR_CHANNEL_ID/details/

Also, proxy support has not been implemented for Slack yet... not sure if anyone actually wants that anyway.

Starting Marvin

cd /opt/marvin
./marvin

Marvin Help

Marvin responds to private messages privately and responds to channel commands as notices, with the exception of the .5questions command, where the response is always broadcast to the channel.

The following commands are available:

Milliways Commands

.5questions [username]

(alias: .5)

will broadcast the Five Questions, with an optional greeting for username to the channel.

.x4questions [username]

(alias .x4)

will ask additional four Questions.

Mixed Drinks Database Commands

.booze [booze_name_or_prefix]

(alias: .b)

will list Boozes used in the mixed drink database. This works as a string prefix search. If there is more than one match, all matches will be listed. If no argument is given, all Boozes will be listed. If only one Booze matches, the list of Drinks using that Booze will be shown.

.drink [drink_name_or_prefix]

(alias: .d)

will display Drink recipes from the mixed drink database. This works as a string prefix search. If there is more than one match, all matches will be listed. If no argument is given, all Drinks will be listed. If only one Drink matches, the recipe for that drink will be shown.

Answering Machine Commands

.tell

(alias: .t)

will send a message to nick the next time they join or talk in channel. Private tells will be sent privately.

Hash Cracking / md5decrypt Commands

If md5decrypt API credentials are provided, the following hash types can be cracked via Marvin:

.md5 [hash]

.md4 [hash]

.sha1 [hash]

.sha256 [hash]

.sha384 [hash]

.sha512 [hash]

.ntlm [hash]

Markov Chain Quote Commands

.m

Hear from Marvin, the paranoid android.

.mcfly

For a change of tone, hear from Marty McFly.

The quotes can be customized used the markov-gen command from this package: https://github.com/awgh/markov

marvin's People

Contributors

awgh avatar mcfly avatar ryd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

marvin's Issues

Whisky is spelt incorrectly

Unfortunately, various instances of 'whiskey' abound in this program.

It's rather jarring. Can this be fixed to reflect the authentic spelling?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.