-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from suggestionsbot/docs/errors
📝 Add in documentation for reading errors
- Loading branch information
Showing
3 changed files
with
237 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
--- | ||
sidebar_position: 5 | ||
title: Error Codes | ||
description: Find more information on various error codes the bot can provide and what to do about it. | ||
--- | ||
import ErrorEmbed from '@site/src/components/Embeds/ErrorEmbed'; | ||
import { DiscordInlineCode } from '@skyra/discord-components-react'; | ||
|
||
## Table | ||
| Code | Name | Guide | | ||
|------|--------------------------------------------|------------------------------------------------------| | ||
| 1 | SUGGESTION_MESSAGE_DELETED | [click](#suggestion-message-deleted) | | ||
| 2 | MISSING_PERMISSIONS | [click](#missing-permissions) | | ||
| 3 | MISSING_SUGGESTIONS_CHANNEL | [click](#missing-suggestions-channel) | | ||
| 4 | MISSING_LOG_CHANNEL | [click](#missing-log-channel) | | ||
| 5 | SUGGESTION_NOT_FOUND | [click](#suggestion-not-found) | | ||
| 6 | OWNER_ONLY | [click](#owner-only) | | ||
| 7 | SUGGESTION_CONTENT_TOO_LONG | [click](#suggestion-content-too-long) | | ||
| 8 | INVALID_GUILD_CONFIG_CHOICE | [click](#invalid-guild-config-choice) | | ||
| 9 | COMMAND_ON_COOLDOWN | [click](#command-on-cooldown) | | ||
| 10 | GENERIC_FORBIDDEN | [click](#generic-forbidden) | | ||
| 11 | UNHANDLED_ERROR | [click](#unhandled-error) | | ||
| 12 | GENERIC_NOT_FOUND | [click](#generic-not-found) | | ||
| 13 | CONFIGURED_CHANNEL_NO_LONGER_EXISTS | [click](#configured-channel-no-longer-exists) | | ||
| 14 | MISSING_PERMISSIONS_IN_SUGGESTIONS_CHANNEL | [click](#missing-permissions-in-suggestions-channel) | | ||
| 15 | MISSING_PERMISSIONS_IN_LOGS_CHANNEL | [click](#missing-permissions-in-logs-channel) | | ||
| 16 | MISSING_TRANSLATION | [click](#missing-translation) | | ||
|
||
## Error Information | ||
|
||
### Suggestion Message Deleted | ||
This error is thrown when attempting to manage a suggestion which its corresponding message has been deleted. | ||
<ErrorEmbed title="Command failed" description="Looks like this suggestion was deleted." code={1} /> | ||
|
||
### Missing Permissions | ||
This error is thrown when the bot is missing permissions to perform an action, and it knows what permissions are missing. | ||
|
||
The required permissions will be displayed in the error message. | ||
<ErrorEmbed | ||
title="Missing Permissions" | ||
description={ | ||
<> | ||
I need the following permissions in order to run this command. | ||
<br /><br /> | ||
Missing permissions edit suggestions in your suggestions channel | ||
<br /><br /> | ||
Please contact an administrator and ask them to provide them for me. | ||
</> | ||
} | ||
code={2} /> | ||
|
||
### Missing Suggestions Channel | ||
This error is thrown when attempting to run a command which requires a configured suggestions channel, but one does not exist. | ||
<ErrorEmbed | ||
title="Missing Suggestions Channel" | ||
description={ | ||
<> | ||
This command requires a suggestion channel to use. | ||
<br /><br /> | ||
Please contact an administrator and ask them to set one up using the | ||
following command. | ||
<br /><br /> | ||
<DiscordInlineCode>/config channel</DiscordInlineCode> | ||
</> | ||
} | ||
code={3} /> | ||
|
||
### Missing Log Channel | ||
This error is thrown when attempting to run a command which requires a configured suggestions log channel, but one does not exist. | ||
<ErrorEmbed | ||
title="Missing Suggestions Channel" | ||
description={ | ||
<> | ||
This command requires a log channel to use. | ||
<br /><br /> | ||
Please contact an administrator and ask them to set one up using the following command. | ||
<br /><br /> | ||
<DiscordInlineCode>/config logs</DiscordInlineCode> | ||
</> | ||
} | ||
code={4} /> | ||
|
||
### Suggestion Not Found | ||
This error is thrown when the bot is unable to find a suggestion with the given ID. | ||
<ErrorEmbed title="Command failed" description="No suggestion exists with this id." code={5} /> | ||
|
||
### Owner Only | ||
This error is thrown when attempting to run a command which is only available to the bot owners. | ||
<ErrorEmbed title="Command failed" description="You do not have permission to run this command." code={6} /> | ||
|
||
|
||
### Suggestion Content Too Long | ||
This error is thrown when the bot is unable to submit a suggestion with a content length greater than the configured maximum length of 1,000 characters. | ||
<ErrorEmbed title="Command failed" description="Your suggestion content was too long, please limit it to 1000 characters or less." code={7} /> | ||
|
||
### Invalid Guild Config Choice | ||
This error is thrown when trying to view an invalid configuration choice. | ||
<ErrorEmbed title="Command failed" description="The provided guild config choice doesn't exist." code={8} /> | ||
|
||
### Command On Cooldown | ||
This error is thrown when the bot is on cooldown for a command. | ||
<ErrorEmbed title="Command on Cooldown" description="Ahh man so fast! You must wait 3 seconds to run this command again" code={9} /> | ||
|
||
### Generic Forbidden | ||
This error is thrown as a generic response when the bot is forbidden from performing an action, and it cannot figure out what permissions are missing. | ||
<ErrorEmbed | ||
title="Unknown message" | ||
description={ | ||
<> | ||
Looks like something went wrong. | ||
Please make sure I have all the correct permissions in your configured channels. | ||
</> | ||
} | ||
code={10} /> | ||
|
||
### Unhandled Error | ||
This error is thrown when the bot is unable to handle an error. Please reach out to support if you see this message. | ||
<ErrorEmbed | ||
title="Something went wrong" | ||
description={ | ||
<> | ||
Please contact support. | ||
<br /><br /> | ||
Guild ID: 601219766258106399 | ||
</> | ||
} | ||
code={11} /> | ||
|
||
### Generic Not Found | ||
This error is thrown as a generic response when the bot is unable to find an item. | ||
<ErrorEmbed | ||
title="Command failed" | ||
description={ | ||
<> | ||
I've failed to find something, please retry whatever you were doing. | ||
<br /><br /> | ||
If this error persists, please contact support. | ||
<br /><br /> | ||
Guild ID: 601219766258106399 | ||
</> | ||
} | ||
code={12} /> | ||
|
||
### Configured Channel No Longer Exists | ||
This error is thrown when either the suggestions channel or suggestions logs channel can no longer be found. The error is displayed interchangeably. | ||
<ErrorEmbed | ||
title="Configuration Error" | ||
description={ | ||
<> | ||
I cannot find your configured channel for this command. | ||
<br /><br /> | ||
Please ask an administrator to reconfigure one. | ||
</> | ||
} | ||
code={13} /> | ||
|
||
### Missing Permissions In Suggestions Channel | ||
This error is thrown when the bot doesn't have permissions to use the configured suggestions channel. | ||
<ErrorEmbed title="Configuration Error" description="I do not have permission to use your guilds configured suggestions channel." code={14} /> | ||
|
||
### Missing Permissions In Logs Channel | ||
This error is thrown when the bot doesn't have permissions to use the configured suggestions logs channel. | ||
<ErrorEmbed title="Configuration Error" description="I do not have permission to use your guilds configured logs channel." code={15} /> | ||
|
||
### Missing Translation | ||
This error is thrown when attempting to translate a nonexistent localization key. | ||
<ErrorEmbed | ||
title="Something went wrong" | ||
description={ | ||
<> | ||
Please contact support. | ||
<br /><br /> | ||
Guild ID: 601219766258106399 | ||
</> | ||
} | ||
code={16} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import { | ||
DiscordMessages, | ||
DiscordMessage, | ||
DiscordEmbed, | ||
DiscordEmbedDescription, | ||
DiscordEmbedFooter, | ||
} from '@skyra/discord-components-react'; | ||
import { EmbedColor, ErrorEmbedProps } from '../../constants'; | ||
|
||
export default function ErrorEmbed({ | ||
title, | ||
description, | ||
code, | ||
}: ErrorEmbedProps): JSX.Element { | ||
return ( | ||
<div className='padding-bottom--md'> | ||
<DiscordMessages> | ||
<DiscordMessage profile='suggestions' ephemeral> | ||
<DiscordEmbed | ||
slot='embeds' | ||
color={EmbedColor.ERROR} | ||
embedTitle={title}> | ||
<DiscordEmbedDescription slot='description'> | ||
{description} | ||
</DiscordEmbedDescription> | ||
<DiscordEmbedFooter slot='footer' timestamp={new Date()}> | ||
Error code {code} | Cluster 1 | ||
</DiscordEmbedFooter> | ||
</DiscordEmbed> | ||
</DiscordMessage> | ||
</DiscordMessages> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4c2b179
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.
Successfully deployed to the following URLs:
docs – ./
docs-git-main-suggestionsbot.vercel.app
docs-suggestionsbot.vercel.app
docs-nine-alpha.vercel.app
docs.suggestionsbot.com
docs.suggestions.gg