CedArctic / Chimera

System Remote Control Discord Bot written in Python discord.py
MIT License
87 stars 23 forks source link

Display cmd and powershell output in discord chat. #10

Closed DragosPopse closed 5 years ago

DragosPopse commented 5 years ago

1

You are now able to call !echo on and !echo off to activate or deactivate command output display in discord chat. I added the echo module at the bottom of the file and modified cmd and powershell module to integrate the feature. For this to work I had to make a global variable at the top of the file (display_output, modified by echo module and accessed by cmd and powershell modules).

I noticed that screenshot required CHANNEL_ID to work, which made the bot send the screenshot on CHANNEL_ID regardless of the channel the actual command was called on. (if you called screenshot in other channel the upload would still be made in CHANNEL_ID). I removed the need for a channel id and now the channel is detected automatically, meaning that the bot will always send the screenshot on the channel you called the command. If it was intended to send on one channel only I'll revert the change or add an option for it.

CedArctic commented 5 years ago

Thanks for your contribution! I'll take a look into the code and let you know my thoughts 😄

CedArctic commented 5 years ago

I did some styling fixes and decided to keep the CHANNEL_ID variable in place in case we add a feature that requires it. The screenshot mod is a nice addition to Chimera. I'll merge the PR. Thanks for the commit man!