-
Notifications
You must be signed in to change notification settings - Fork 55
Conversation
Since this prints error traces to console, maybe it should print results that are too long to console as well. Alternatively, it could upload a txt file with the results |
src/jselfbot/commands/BashCmd.java
Outdated
try { | ||
reply("Input: ```\n" + args + "``` Output: \n```\n" + finalOutput + "```", event); | ||
} catch (IllegalArgumentException e) { | ||
reply("Command output too long!", event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make it so it prints it to console, similar to how it does on an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I can do it later if Spotlight can't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're welcome to, I've been busy due to personal reasons and have yet to mess with it.
After messing around with the command for a bit, I found out that See also, https://stackoverflow.com/a/23878137/3874884 (Also, I added in outputting to console. Uploading a file wouldn't be fun as we'd have to check permissions and blek.) |
What about instead of uploading a file it just posts to pastebin or something like that? Would there have to be a perm check for the file upload? Wouldn't it just fail silently? |
Doing pastebin could work indeed, though we'd have to bring up an API and even then I'd rather use Ghostbin (or a user might want to use Hastebin, etc). If jag wants it I could add it, otherwise output to the console is good for now. |
Or writting it to a .txt file and uploading it to Discord?
El ago 13, 2017 6:59 PM, "Spotlight" <notifications@github.com> escribió:
… Doing pastebin could work indeed, though we'd have to bring up an API and
even then I'd rather use Ghostbin for that point. If jag wants it I could
add it, otherwise output to the console is good for now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AI2CdddNnBiPFR7mqpc5LF1GO8JJ5EpNks5sX43OgaJpZM4OgpMK>
.
|
Yeah the text file sounds fine, he just said it'd be a pain because of
upload perms.
…On Sun, Aug 13, 2017 at 11:14 PM, Artuto ***@***.***> wrote:
Or writting it to a .txt file and uploading it to Discord?
El ago 13, 2017 6:59 PM, "Spotlight" ***@***.***> escribió:
> Doing pastebin could work indeed, though we'd have to bring up an API and
> even then I'd rather use Ghostbin for that point. If jag wants it I could
> add it, otherwise output to the console is good for now.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#41 (comment)>, or
mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/
AI2CdddNnBiPFR7mqpc5LF1GO8JJ5EpNks5sX43OgaJpZM4OgpMK>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#41 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFTY8Pnr0Rn6PkEwbtwQGTr1C3OFtsTsks5sX8m2gaJpZM4OgpMK>
.
--
Yours Truly,
Alexander Wallen
|
Gonna merge this now, might be a good idea to add the txt file upload at some point in the future though |
This PR would fix #38 if merged. It outputs the command in a similar format to eval (saying both input and output) but has a major drawback.
It would appear that
Runtime.getRuntime().exec
has issues with relative commands. For example, you're unable tobash ls -l ~
but you're able tobash ls /home/spotlight
, which I find odd. I have no idea what the issue is and it would appear that Google doesn't either.Special thanks to @ArtutoGamer for helping me out with this as well. This PR is 10000x better than #39 😅