PHPackages                             portlandlabs/slackbot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. portlandlabs/slackbot

ArchivedProject[API Development](/categories/api)

portlandlabs/slackbot
=====================

A Slackbot that uses the slack RTM API and the slack web API. Built on PSR components

0.0.1(7y ago)136MITPHPPHP ^7.2

Since Oct 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/PortlandLabs/slackbot)[ Packagist](https://packagist.org/packages/portlandlabs/slackbot)[ RSS](/packages/portlandlabs-slackbot/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (14)Versions (1)Used By (0)

Slackbot
========

[](#slackbot)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5175741d7e2da89ae26349512c8ac00dc92e19d01e8afbdf245c3b69e2ebb04a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706f72746c616e646c6162732f736c61636b626f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/portlandlabs/slackbot)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)[![Build Status](https://camo.githubusercontent.com/32cacc600e9f8202c00a9dbe768950b86a77e09dab5f4444f827554f8127785c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f706f72746c616e646c6162732f736c61636b626f742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/portlandlabs/slackbot)[![Coverage Status](https://camo.githubusercontent.com/4a260df79e67065ef1a293cd033d0a580da3a937fade04e4faf898c7b7216188/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f706f72746c616e646c6162732f736c61636b626f742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/portlandlabs/slackbot/code-structure)[![Quality Score](https://camo.githubusercontent.com/2ff131891dc13a2a04e830f563dba8b60d61461d623d3cfdc98b6f28574ee864/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706f72746c616e646c6162732f736c61636b626f742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/portlandlabs/slackbot)[![Total Downloads](https://camo.githubusercontent.com/9352e35aad78c00aaaa35ea04f7d584d8992d42b13ddf59b037e46f6dd1add96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706f72746c616e646c6162732f736c61636b626f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/portlandlabs/slackbot)

This SlackBot is a fully featured slack bot in the style of old IRC bots with the power of new fancy bots. You can react to arbitrary messages like tracking emojis in a message like "Giving some ❤️ to @user", or build simple call and response style messages like `@bot dosomething`

Getting Started
---------------

[](#getting-started)

### Setup

[](#setup)

First configure your slackbot by copying `.env.dist` to `.env` and configuring the required details

```
$ cp .env.dist > .env
```

### Running the bot

[](#running-the-bot)

The Slackbot is powered by a single PHP script, run it to get started:

```
$ php slackbot.php
```

Permissions and Roles
---------------------

[](#permissions-and-roles)

Slackbot actions are managed by `roles`. The available roles are `Bot`, `User`, and `Admin`

RoleExtendsHow to Access`User``-`Don't be a bot`Admin``User`Use the bot in the configured Admin channel`Bot``-`Send a message through the Slack Web API with `as_user` disabledCommands
--------

[](#commands)

Commands are triggered by events flowing through the `RTM` API. Any event with the type `message` will flow through the command stack.

A basic command defines `->shouldHandle(Message $message)` and `->handle(Message $message)`, but `SimpleCommand` makes things a little easier to implement. Commands that extend `SimpleCommand` work much the same as console commands. Declare your `$signature` property and a `run(Message $message, ArgumentManager $manager)` method, and the super class will manage hooking everything up.

### Adding commands to the bot

[](#adding-commands-to-the-bot)

You can add commands to the bot through the bot's command manager:

```
$bot->commands()->addCommand(CustomCommand::class);
```

**Adding Default Commands:**
We've wrapped the default commands in a simple provider:

```
(new \PortlandLabs\Slackbot\Command\DefaultProvider())->register($bot);
```

### Sending messages to slack

[](#sending-messages-to-slack)

There are a few ways to send messages to slack from a command:

1. `RTM` API with Typing indicator

    When using the `RTM` API you have the ability to trigger typing indicators (so that slack says the bot is typing)

    ```
    $this->bot->feignTyping($channel, $message)
    ```

    The result of this method is a Promise that resolves when Slack acknowledges the sent message.
2. `RTM` API without typing

    If you don't want the (creepy) typing indicator and you want to be upfront with the fact that your bot doesn't type,

    ```
    $this->bot->rtm()->sendMessage($channel, $message)
    ```

    The result of this is also a Promise
3. `Web` API with ability to Update

    The `Web` API uses HTTP to send messages to slack and so can be a bit slower than using the `RTM` API with the added benefit of a ton of added power.

    **Simple Usage**:
    The simplest usage is with the Payload Builder:

    ```
    $api = $this->bot->api();
    $api->getBuilder()->send($message)->to($channel)->withIcon($icon)->execute($api);

    // Update the previously sent message
    $api->getBuilder()->update()->withText($newText)->execute($api);
    ```

    **Complex Usage**:
    If you're looking for more power or for different endpoints, you can simply build payloads directly and send them with the API

    ```
    $payload = new ChatPostMessagePayload();
    $this->prepare($payload);

    // Send the payload
    $payloadResponse = $this->bot->api()->send($payload);
    ```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2829d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/842d2fe13512e82f0f9b6f0d79dba8eba1595a3cefd31dd51723960436133307?d=identicon)[KorvinSzanto](/maintainers/KorvinSzanto)

---

Top Contributors

[![KorvinSzanto](https://avatars.githubusercontent.com/u/1007419?v=4)](https://github.com/KorvinSzanto "KorvinSzanto (14 commits)")

### Embed Badge

![Health badge](/badges/portlandlabs-slackbot/health.svg)

```
[![Health](https://phpackages.com/badges/portlandlabs-slackbot/health.svg)](https://phpackages.com/packages/portlandlabs-slackbot)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[laravel-zero/framework

The Laravel Zero Framework.

3491.5M419](/packages/laravel-zero-framework)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
