Comments (12)
Comment from Leon Sandøy:
mentioned in merge request !47
from bot.
It seems we are moving away from embeds in favour of plain messages because they have less clutter. The downside is that they are no longer as prominent as they would be if they were embeds.
Which direction to take is still open for discussion.
from bot.
Some additional context:
The default error handler currently does not use embeds. However, some commands/cogs have their own error handlers which do use embeds. For example: utils
and snekbox
. These embeds also take a random error message to display in the title.
from bot.
Closing this in favour of #131
from bot.
I think it's best to keep this a separate issue from #131 as this issue is concerned with formatting of errors in all cogs while the other is concerned with coverage of errors in the main error handler.
from bot.
In #1058, we're changing the error handler so that all errors will return an embed. It looks like this:
This isn't perfect, but it adds some sorely needed sanity and looks slightly more professional. However, we should probably open a pull request that will turn these two embeds into one.
from bot.
#1058 has been merged.
However, we should probably open a pull request that will turn these two embeds into one.
I'm not sure if it would look much better as one embed, since it may be a bit messy. Having this as 2 different embeds separates the subjects into an "error" and "help" field, may not be the best when put together.
Thoughts, @MarkKoz?
from bot.
Hard to say without seeing what it'd look like. It could probably get away with only showing the usage code block from the help embed - the aliases and descriptions can be omitted.
In any case, there are some situations where showing the help isn't even useful. The screenshot above perfectly illustrates that. The help message is more useful when an argument is missing or if the error message is too generic (like an invalid type).
This is just one aspect of the issue. I believe there are still places where commands directly output error messages rather than raising exceptions. They inconsistently use embeds or plain messages, and the formats of those may also be inconsistent.
from bot.
I read back the whole issue, starting from the beginning.
I believe most of the times showing one embed with the usage (like in Sir Lancebot's error handler.) is more consistent than the current one (Showing two embeds)
But we can make specific cases for specific errors, like not showing the usage just the error message!(Although, at that point, I don't think it's a huge problem that it shows the usage, even if it seems it is not helpful.)
(I'd be interested in helping implement this)
from bot.
- Regarding the OP, I don't think it's necessary for all error messages to be in the same format. The bot is massive and is comprised of extensions, some of which have their own unique aspects. For example, the default error message for a bad or missing argument is handled by the error handler and is posted as an embed, but for some moderation commands there might be errors which are out of the moderator's control (e.g the member left the server). In the latter case it's more useful to have a concise error message in plaintext to explain what happened, instead of dumping the help embed, which is annoying especially when it happens in a public channel. To summarize, I think it's ok for different features to display errors in ways that are appropriate to them.
- Another point in the OP is whether all plaintext errors should have emojis. I think they're nice visual cues. Not sure if I would bother enforcing it, but I take care to add them when writing plaintext errors.
- I think we should merge the error and the help embed like in sir-lancebot. This also simplifies a possible migration of the error handler to bot-core. Most people here seem to be in favor, so unless there are strong opinions against let's stick with this direction from now on.
from bot.
One option for merging the embeds now is something like this with buttons, where the "Help" button could send an ephemeral message with the contents of the help command.
from bot.
Looks good. Let's just go for it.
from bot.
Related Issues (20)
- Automatic invalidation of DIscord bot tokens HOT 2
- Project
- False alerts caused by incorrect regex url for `rich_embed` filter HOT 2
- AttributeError: 'NoneType' object has no attribute 'fetch_message'
- KeyError: AtomicList(id=4, created_at=<Arrow [2023-04-06T16:45:04.133185+00:00]>, updated_at=<Arrow [2023-0...
- Handling of site connection issues during outage. HOT 1
- Log indication of someone trying to voice verify.
- A command to append to a nomination reason HOT 2
- A context menu command to nominate users HOT 7
- Supporting diffs in Github links HOT 1
- Update tests to ensure that infractions sent to the DB are NOT truncated (even if so on Discord's side)
- Forbidden: 403 Forbidden (error code: 40058): Cannot message this thread until after the post author has sen...
- Automatically apply pardoned timeouts upon rejoining the server HOT 1
- Multi-Purpose Discord Bot
- DM users opening a help post
- Remove `rich_embed` filter HOT 3
- Update ban confirmation button labels and colours
- Home
- Document how to invoke tags within tag groups in `/tag` command
- Avoid deleting reminders silently
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 bot.