Comments (7)
I am fine leaving it as is....its a side effect of 'click' :)
from mmpy_bot.
Hi @sw-dbrown this was fixed in f6d8b98 which hasn't been released yet. Would you mind trying the latest version from the main
branch and see if the problem persists?
from mmpy_bot.
Hey @unode, thanks for the very fast response. I just manually applied the patch in my venv and I can confirm that the issue is fixed in f6d8b98. Is it intended behavior that the output of the --help
command is also sent to the log of the bot?
Hi @sw-dbrown this was fixed in f6d8b98 which hasn't been released yet. Would you mind trying the latest version from the
main
branch and see if the problem persists?
from mmpy_bot.
Not intended but harder to control as it's pre-defined behavior in click
.
There may be a workaround but the crash was the most important part.
Either way, I would discourage the use of --help
as we can't easily control the content of the output.
from mmpy_bot.
I had a second look at the code and we could use:
with contextlib.redirect_stdout(io.StringIO()):
ctx = self.function.make_context(
info_name=self.plugin.__class__.__name__, args=list(args)
)
at
Line 160 in 641b918
but I don't like this solution. It could accidentally discard other messages which would make it painful to debug.
I also don't think that filtering out --help
from args
is a good solution.
Any other from those in this thread? I'm tempted to close this issue as-is without additional patches.
from mmpy_bot.
So the remaining issue is that with plugins which use 'click' functions, when the plugin gets the '--help' command, the output shows up in the channel and also in the log?
from mmpy_bot.
Output is sent to stdout stream, not really the log.
from mmpy_bot.
Related Issues (20)
- Send a message direct to user who joins room HOT 2
- RuntimeError: this event loop is already running. HOT 9
- No connection with docker image 2.0.0 and MM7.1.3 HOT 2
- Improvement: Add `type` optional param for `create_post(...)` function HOT 7
- Unable to run concurrent asyncio processes HOT 5
- [Question] Register plugins at runtime HOT 1
- Scheduled responses to channel instead of reply HOT 5
- How to send files to bot directly for some postpone processing? HOT 3
- HTTP/1.1 404 Not Found : Wrong api endpoint HOT 4
- dev requirements inside main project HOT 3
- [Feature Request] Handler for message editions HOT 1
- Need to fix issue flagged when using latest Pytype HOT 2
- Websocket HOT 3
- Legal way to get raw events HOT 6
- Mandatory MATTERMOST_PORT breaks MATTERMOST_URL with subpaths HOT 2
- Disable httpx logging? HOT 2
- Reading previously sent messages HOT 1
- Bot.run does not return when stop is called HOT 3
- Bot fails to respond with copied ping if username is capitalized HOT 2
- Import plugins from separate files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmpy_bot.