Skip to content

Commit

Permalink
InABox: Use slack external send_file instead of api directly
Browse files Browse the repository at this point in the history
This also moves us to the new APIs, as files.upload is deprecated
  • Loading branch information
Davis-A committed Sep 25, 2024
1 parent 3e24929 commit aeea642
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/Synergy/Reactor/InABox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,8 @@ async sub _setup_droplet ($self, $event, $droplet, $key_file, $args = []) {
if ($event->from_channel->isa('Synergy::Channel::Slack')) {
$message .= " Here's the output from setup:";

return await $event->from_channel->slack->api_call(
'files.upload',
{
form_encoded => 1, # Sigh.

content => "$stderr\n----(stdout)----\n$stdout",
channels => $event->conversation_address,
initial_comment => $message,
},
);
my $content = "$stderr\n----(stdout)----\n$stdout";
await $event->from_channel->slack->send_file($event->conversation_address, 'setup.log', $content);
} else {
$Logger->log("we ran ssh, but not via Slack, so stdout/stderr discarded");
}
Expand Down

0 comments on commit aeea642

Please sign in to comment.