-
-
Notifications
You must be signed in to change notification settings - Fork 131
Create getComponents.js #731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v6
Are you sure you want to change the base?
Conversation
This is a function I made, it is used to read components, it helps a lot since now some bots are using v2 components, so it would be good to get ahead of that kind of things Use: $getComponents[$channelID?;$messageID]
Please edit the Issue description properly, thanks |
I have already modified the description |
); | ||
} | ||
|
||
const channel = d.client.channels.cache.get(channelID); |
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.
const channel = d.client.channels.cache.get(channelID); | |
const channel = d.util.getChannel(channelID); |
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.
corrected
if (!channel) { | ||
return d.aoiError.fnError( | ||
d, | ||
"custom", | ||
{ inside: data.inside }, | ||
`Channel with ID "${channelID}" was not found.` | ||
); | ||
} |
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.
if (!channel) { | |
return d.aoiError.fnError( | |
d, | |
"custom", | |
{ inside: data.inside }, | |
`Channel with ID "${channelID}" was not found.` | |
); | |
} | |
if (!channel) { | |
return d.aoiError.fnError( | |
d, | |
"channel", | |
{ inside: data.inside }, | |
); | |
} |
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.
corrected
return d.aoiError.fnError( | ||
d, | ||
"custom", | ||
{ inside: data.inside }, | ||
`Failed to fetch message with ID "${messageID}".` | ||
); |
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.
return d.aoiError.fnError( | |
d, | |
"custom", | |
{ inside: data.inside }, | |
`Failed to fetch message with ID "${messageID}".` | |
); | |
return d.aoiError.fnError( | |
d, | |
"message", | |
{ inside: data.inside }, | |
); |
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.
corrected
return d.aoiError.fnError( | ||
d, | ||
"custom", | ||
{ inside: data.inside }, |
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.
{ inside: data.inside }, | |
{}, |
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.
corrected
return d.aoiError.fnError( | ||
d, | ||
"custom", | ||
{ inside: data.inside }, | ||
"You must provide the message ID." | ||
); |
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.
return d.aoiError.fnError( | |
d, | |
"custom", | |
{ inside: data.inside }, | |
"You must provide the message ID." | |
); | |
return d.aoiError.fnError( | |
d, | |
"message", | |
{ inside: data.inside }, | |
); |
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.
corrected
const data = d.util.aoiFunc(d); | ||
if (data.err) return d.error(data.err); | ||
|
||
const [channelID = d.channel?.id, messageID] = data.inside.splits; |
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.
const [channelID = d.channel?.id, messageID] = data.inside.splits; | |
const [channelID = d.channel?.id, messageID = d.message?.id] = data.inside.splits; |
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.
corrected
I already made the changes you mentioned above.
Description
This is a function I made, it is used to read components, it helps a lot since now some bots are using v2 components, so it would be good to get ahead of that kind of things
Use: $getComponents[$channelID?;$messageID]
Type of change
Please check options that describe your Pull Request: