kynno/smartbots-bundle

Symfony integration for SmartBots from SecondLife

Installs: 2 688

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 1

Type:symfony-bundle

v0.3 2020-01-17 19:37 UTC

This package is auto-updated.

Last update: 2024-04-18 06:07:43 UTC


README

Build Status GitHub release (latest by date) GitHub SymfonyInsight

SmartBots is a service provider which allows you to manage your Second Life group and/or control your Second Life bots. All SmartBots services use the abilities of SL bots: group inviters, group chat translators, automatic notice delivery system etc.

This bundle integrates a fast way to use their API with minimum settings.

You can find more informations about them at http://www.mysmartbots.com/docs/SmartBots_Documentation

Prerequisites

In order to use this bundle, you will need to get your developer API Key.

  • PHP 7.1+
  • Symfony 3.4 / 4.0+ / 5.0+

Installation

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

$ composer require kynno/smartbots-bundle

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require kynno/smartbots-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

// config/bundles.php

return [
    // ...
    Kynno\SmartBotsBundle\SmartBotsBundle::class => ['all' => true],
];

Usage

The list of the commands available are available on the official website of SmartBots: https://www.mysmartbots.com/dev/docs/HTTP_API/Bot_Commands

This is an example of configuration for config/packages/smartbots.yaml,

kynno_smartbots:
    api_key: <your_api_key>
    bots:
        Kynno:
            name: "KynnoSystem Resident"
            botSecret: pwd
        Leekyn:
            name: "Leekyn Resident"
            botSecret: pwd

Under the bots key, you can have multiple bots. In this example, Kynno and Leekyn are the IDs of the bots. Using the SmartBots service, you need to use these IDs instead of the full name of your bots.

Of course, you can have only one bot.

Once you configured your credentials, you can start using the service Kynno\SmartBotsBundle\Service\SmartBots.

<?php

$this->smartBots->im('Heyter Nitely', "Hey, it's working!");
// or
$this->smartBots->getBot('Leekyn')->im('Heyter Nitely', "Hey, it's working with a specific bot!");

Note: If you don't select a bot before a command, it will auto select the first one.

Don't hesitate to open the file AbstractSmartBotsCommands.php to see how to use the different commands.