Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reactions #65

Open
iNilo opened this issue Nov 22, 2020 · 1 comment
Open

Add support for reactions #65

iNilo opened this issue Nov 22, 2020 · 1 comment

Comments

@iNilo
Copy link

iNilo commented Nov 22, 2020

I'd love to reply to a message / command, not by text, but by reaction.

I'm trying to look into this myself, but I'm not experienced enough yet

eg:

$botman->hears('wave', function (BotMan $bot)
{
       $bot->replyWithReaction("thumbsup");
});

https://api.slack.com/methods/reactions.add

I suppose it would need to be added here

} elseif ($this->resultType == self::RESULT_DIALOG) {

@iNilo
Copy link
Author

iNilo commented Nov 24, 2020

For those stumbling across this issue:

Currently I'm achieving this with a 2nd framework

https://github.com/jolicode/slack-php-api

$SlackClient = JoliCode\Slack\ClientFactory::create($SLACK_TOKEN);

$botman->hears('thumbsup', function (BotMan $bot)
{
	global $SlackClient;
	$SlackClient->reactionsAdd(
		[
			'channel' => $bot->getMessage()->getPayload()->get('channel'),
			'name' => 'thumbsup',
			'timestamp' => $bot->getMessage()->getPayload()->get('ts'),
		]);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant