All Projects → mattermost → Mattermost Bot Sample Golang

mattermost / Mattermost Bot Sample Golang

Licence: apache-2.0

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Mattermost Bot Sample Golang

Tgmeetup
A collection set of technical groups' information (meetup).
Stars: ✭ 139 (-0.71%)
Mutual labels:  hacktoberfest
Pipedrive
Complete Pipedrive API client for PHP
Stars: ✭ 138 (-1.43%)
Mutual labels:  hacktoberfest
Jhipster Online
JHipster Online lets you generate your JHipster projects through a user friendly web interface.
Stars: ✭ 140 (+0%)
Mutual labels:  hacktoberfest
Chromebrew
Package manager for Chrome OS
Stars: ✭ 1,838 (+1212.86%)
Mutual labels:  hacktoberfest
Android Modular Architecture
📚 Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.
Stars: ✭ 2,048 (+1362.86%)
Mutual labels:  hacktoberfest
Tinyafl
Stars: ✭ 140 (+0%)
Mutual labels:  hacktoberfest
Marketplace Partners
Image validation, automation, and other tools for DigitalOcean Marketplace partners and Custom Image users
Stars: ✭ 139 (-0.71%)
Mutual labels:  hacktoberfest
Notion Enhancer
an enhancer/customiser for the all-in-one productivity workspace notion.so (app)
Stars: ✭ 3,114 (+2124.29%)
Mutual labels:  hacktoberfest
Omr
Optical Mark Recognition with PHP
Stars: ✭ 138 (-1.43%)
Mutual labels:  hacktoberfest
Awesome Ember
A curated list of awesome Ember.js stuff like addons, articles, videos, gists and more.
Stars: ✭ 140 (+0%)
Mutual labels:  hacktoberfest
Jigsaw
Simple static sites with Laravel’s Blade.
Stars: ✭ 1,823 (+1202.14%)
Mutual labels:  hacktoberfest
Ignition
A beautiful error page for Laravel apps
Stars: ✭ 1,885 (+1246.43%)
Mutual labels:  hacktoberfest
Vuex Composition Helpers
A util package to use Vuex with Composition API easily.
Stars: ✭ 139 (-0.71%)
Mutual labels:  hacktoberfest
Descheduler
Descheduler for Kubernetes
Stars: ✭ 2,260 (+1514.29%)
Mutual labels:  hacktoberfest
Gosu
2D game development library for Ruby and C++
Stars: ✭ 1,762 (+1158.57%)
Mutual labels:  hacktoberfest
Hacktoberfest2018
A repository for HacktoberFest 2018.
Stars: ✭ 139 (-0.71%)
Mutual labels:  hacktoberfest
Enwrite
Evernote-powered statically-generated blogs and websites
Stars: ✭ 139 (-0.71%)
Mutual labels:  hacktoberfest
Awesome Vehicle Security
🚗 A curated list of resources for learning about vehicle security and car hacking.
Stars: ✭ 1,931 (+1279.29%)
Mutual labels:  hacktoberfest
Pueue
🌠 Manage your shell commands.
Stars: ✭ 2,471 (+1665%)
Mutual labels:  hacktoberfest
Educative.io Downloader
📖 This tool is to download course from educative.io for offline usage. It uses your login credentials and download the course.
Stars: ✭ 139 (-0.71%)
Mutual labels:  hacktoberfest

Mattermost Bot Sample

Overview

This sample Bot shows how to use the Mattermost Go driver to interact with a Mattermost server, listen to events and respond to messages. Documentation for the Go driver can be found here.

Highlights of APIs used in this sample:

  • Log in to the Mattermost server
  • Create a channel
  • Modify user attributes
  • Connect and listen to WebSocket events for real-time responses to messages
  • Post a message to a channel

This Bot Sample was tested with Mattermost server version 3.10.0.

Setup Server Environment

Via Docker And Docker-Compose

1 - Ensure Docker and Docker-Compose are installed for your system

2 - Run ./add_users.sh. The login information for the Mattermost client will be printed

3 - Run docker-compose up -d --build and the mattermost client will be built and will expose the port 8065 to your system's localhost

4 - Start the Bot.

make run

You can verify the Bot is running when

  • Server detected and is running version X.Y.Z appears on the command line.
  • Mattermost Bot Sample has started running is posted in the Debugging For Sample Bot channel.

See "Test the Bot" for testing instructions

Via Direct System Install/Setup

1 - Install or upgrade to Mattermost server version 3.10+, and verify that the Mattermost server is running on http://localhost:8065.

On the commands below, if you are running Mattermost server version 5.0 or later, use ./bin/mmctl. If you are running version 4.10 or earlier, use ./bin/platform.

Learn more about the mmctl CLI tool in the Mattermost documentation.

2 - Create a team for the Bot to run. If you have an existing team, you may skip this step and replace team_name with your existing team in subsequent steps.

./bin/mmctl team create --name botsample --display_name "Sample Bot playground" --email "[email protected]"

3 - Create the user account the Bot will run as.

./bin/mmctl user create --email="[email protected]" --password="Password1!" --username="samplebot"

4 - Create a second user, bill, which we will use to log in and interact with the Bot.

./bin/mmctl user create --email="[email protected]" --password="Password1!" --username="bill"

5 - (Optional) Give bill system_admin permissions.

./bin/mmctl roles system_admin bill

6 - Add users to the team

./bin/mmctl team add botsample samplebot bill

7 - Verify the e-mail address

./bin/mmctl user verify samplebot

8 - Log in to http://localhost:8065 as bill and verify the account was created successfully. Then, navigate to the botsample team you created in step 2 to interact with the Bot.

Setup Bot Development Environment

1 - Follow the Developer Machine Setup instructions to setup the bot development environment.

2 - Clone the GitHub repository to run the sample.

git clone https://github.com/mattermost/mattermost-bot-sample-golang.git
cd mattermost-bot-sample-golang

3 - Start the Bot.

make run

You can verify the Bot is running when

  • Server detected and is running version X.Y.Z appears on the command line.
  • Mattermost Bot Sample has started running is posted in the Debugging For Sample Bot channel.

Test the Bot

1 - Log in to the Mattermost server as [email protected] and Password1!.

2 - Join the Debugging For Sample Bot channel.

3 - Post a message in the channel such as are you running? to see if the Bot responds. You should see a response similar to Yes I'm running if the Bot is running.

Stop the Bot

1 - In the terminal window, press CTRL+C to stop the bot. You should see Mattermost Bot Sample has stopped running posted in the Debugging For Sample Bot channel.

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