Closed adamcollingburn closed 4 years ago
Hi Adam, You can do something like that:
Slack_Bot::get_instance()->send_message( $message, $attachments, $args );
Thanks Dorzki - I tried this and just get Class Slack_Bot could not be found
So I tried to include 'core/class-slack-bot.php' and it says the class is already in use 😅
Don't forget to add the namespace at the top.of the file:
use Slack_Notifications\Slack_Bot;
Or add the namespace before the class name:
Slack_Notifications\Slack_Bot::get_instance()->send_message( $message, $attachments, $args );
Thanks!
Do you know why it'd always be posting to the default channel? I've tried
['channel' => '#artists'] and ['channel' => 'artists']
in $args param and it still just posts to the default channel
@dorzki Any thoughts on this? Do I need to find a channel ID or something?
@DorZuberi Any idea?
Hi @adamcollingburn , Sorry for the late reply, I'm a bit packed up at work.
About your question, Slack have changed the way Webhook works. I will release soon an update to address this issue.
Okay thanks dude
I'm closing this issue because the main question was answered. You may open a new issue about the wrong channel.
Hey @DorZuberi,
Are you any closer to releasing an update for the webhook issue?
As above, I'd like to be able to create my own slack messages from my custom functions but struggling to find a way to do this