We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13dea13 commit 6477c8aCopy full SHA for 6477c8a
lib/Synergy/Reactor/SlackID.pm
@@ -79,4 +79,28 @@ responder reload_slack => {
79
return $event->reply_error("Sorry, I didn't understand your reload command.");
80
};
81
82
+command slacksnippet => {
83
+} => async sub ($self, $event, $text) {
84
+ my $channel = $event->from_channel;
85
+
86
+ unless ($channel->can('slack')) {
87
+ return await $event->error_reply("Sorry, you can't use *slackid* outside Slack");
88
+ }
89
90
+ my $text = join q{}, ("$text\n") x 25;
91
92
+ my $res = await $channel->slack->api_call(
93
+ 'files.upload',
94
+ {
95
+ form_encoded => 1, # Sigh.
96
97
+ content => $text,
98
+ channels => $event->conversation_address,
99
+ initial_comment => "Here's what you said, as a snippet.",
100
+ },
101
+ );
102
103
+ return;
104
+};
105
106
1;
0 commit comments