Skip to content

This is a GroupMe bot that lets people in chat query Magic: The Gathering card information through the ScryFall API.

License

Notifications You must be signed in to change notification settings

jpann/nerdbot-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NerdBot-Core

Build status

This is a GroupMe bot that lets people in chat query Magic: The Gathering card information through the ScryFall API.

This is written using ASP.NET Core 2.2 using NancyFX for the routing. This is basically a copy of my other project NerdBot, but I trimmed down the plugins/commands a bit and removed the dependency on a MongoDB database containing card/set information and it is running on ASP.NET Core 2.2. I'll be updating this instead of the other 'NerdBot' project from now on.

Usage

Overview Steps

  1. Go to GroupMe's bot site and create a new bot and assign it to your GroupMe group.
  2. Make note of the BOTID for the bot you created and provide use it in the Docker environment variable BOTID when creating the docker container below.
  3. Create a Bitly account and get the username and key to provide to the Docker environment variables BITLY_USER' and BITLY_KEY when creating the docker container.
  4. Create the container using the instructions below.
  5. Set your GroupMe bot's 'Callback URL' to the external IP address for the host running the container followed by '/bot/'. For example,

Running with docker

Clone the repository:

    $ git clone https://github.com/jpann/nerdbot-core.git

Create docker image from Dockerfile:

    $ cd ~/nerdbot-core
    $ sudo docker build -t nerdbot-core:1.0.0 .

Run it:

    $ sudo docker run -d -p 3579:3579 --name nerdbot \
	-v /path/to/logs:/app/logs \
	-e TOKEN="<BOT TOKEN>" \
	-e BOTID="<GROUP ME BOT ID" \
	-e BOTNAME="<GROUP ME BOT NAME> \
	-e BITLY_USER=<YOUR BITLEY USER> \
	-e BITLY_KEY=<YOUR BITLEY KEY> \
   -e GIPHY_KEY=<YOUR GIPHY API KEY> \
	nerdbot-core:1.0.0

Point your GroupMe Bot's 'Callback URL' to the address your NerdBot is listening on and use the route /bot/<TOKEN>:

https://myhost.com:3579/bot/TOKEN

Multiple GroupMe Groups

You can have this bot connect to multiple GroupMe groups by pipe (|) delimiting both TOKEN and BOTID:

    $ sudo docker run -d -p 3579:3579 --name nerdbot \
	-v /path/to/logs:/app/logs \
	-e TOKEN="<BOT TOKEN>|<BOT TOKEN 2>" \
	-e BOTID="<GROUP ME BOT ID>|<GROUP ME BOT ID 2>" \
	-e BOTNAME="<GROUP ME BOT NAME> \
	-e BITLY_USER=<YOUR BITLEY USER> \
	-e BITLY_KEY=<YOUR BITLEY KEY> \
   -e GIPHY_KEY=<YOUR GIPHY API KEY> \
	nerdbot-core:1.0.0

Then would would point each bot's 'Callback URL' to the appropriate bot route with that bot's token.

About

This is a GroupMe bot that lets people in chat query Magic: The Gathering card information through the ScryFall API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published