PHP code example of geekdpt / slamp

1. Go to this page and download the library: Download geekdpt/slamp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

geekdpt / slamp example snippets


$client = Slamp\webClient(TOKEN);
yield $client->compose()->sendAsync('Hello there!');

yield $client->compose()->from('Hello Bot')->to('#general')->sendAsync('Hey, wassup #general?');

$message = yield $client->compose()->to('@guy')->sendAsync('I hate you');

# What I have done.. ?!
yield $message->updateAsync('I love u');

# I should calm down...
yield $message->deleteAsync();

$msg = Slamp\webClient(TOKEN)->compose()
    ->from('Sender name')
    ->withIcon(':robot:') # emoji code, or custom image with an URL
    ->to('#channel')
    ->withParsing('full') # defaults to "none", see api.slack.com/docs/message-formatting
    ->linkingNames(true) # defaults to false, sets whether token like #general or @username are parsed and transformed into links
    ->sendAsync('the message text');
    
Amp\wait($msg);