Marvin is a chat bot built on the [Hubot][hubot] framework.
- Node.js
v14.15.x
Clone this repository, then run:
npm install
npm test
You can start Marvin locally by running:
npm start
You'll see some start up output and a prompt:
[Sat Feb 28 2015 12:38:27 GMT+0000 (GMT)] INFO Using default redis on localhost:6379
marvin>
Then you can interact with Marvin by typing marvin help
.
marvin> marvin help
marvin animate me <query> - The same thing as `image me`, except adds [snip]
marvin help - Displays all of the help commands that marvin knows about.
...
You can start Marvin as a local server to connect to Discord.
-
Ask for the
HUBOT_DISCORD_TOKEN
for someone in the team. -
Run:
HUBOT_DISCORD_TOKEN='the token you received' bin/hubot -a discord
- access Google Cloud Platform
- Create a project
- Click on
Enable APIS and services
- Search for gmail and enable it
- Search for calendar and enable it
- Search for youtube and enable it
- Go to Credentials tab (it may ask you to configure consent screen, you should do that)
- While you do that, set an email as test user so you can login with on step 15.
- Click on
Create Credentials
thenOAuth Client ID
- Select the application type
Desktop app
and give it a cool name. - After that you will be prompted with the
Client Secret
andClient ID
You don't need to save that. They will be in a file. - The created OAuth credential will appear in a list called
OAuth 2.0 Client IDs
. Click in the arrow down and download the file. - Download the Json and fill the enviroment variables client id and client secret and the first item from redirect uris
- Execute
node lib/google/gmailConnector.js
- Access the URL that appears in the console
- Login in with Marvin email or you personal email that have test user role
- Allow marvin-gmail-connector access
- Copy the token and paste it back into the console (token.json file will be created)
- Fill the environment variables with the data from token.json and then delete the file.
Tip: in theGMAIL_SCOPE
variable you have to put content inside quotes and apart by space - Run marvin normally
- To use the calendar command you need to fill the variable with an calendar id.
- Go to google calendar, in the left tab, select your calendar or create one. To select, click in the vertical threed dots.
- In
Settings and sharing
you will find aCalendar ID
in the bottom of the page. Fill the variable.
To allow an user to use the !streamyard
command to login into streamyard.com,
add the Discord user ids to the ALLOWED_STREAMYARD_USERS
env var, separated by commas.
To get a Discord User Id, check Where can I find my User/Server/Message ID?.