Paginated Embed error

private async sendPing(message: Message) {
const a = await this.getMods()
return await new PaginatedFieldMessageEmbed()
.setTemplate({ title: 'Test pager embed', color: 0x6080 })
.setItems(a)
.setItemsPerPage(5)
.make()
.run(message)
}
private async sendPing(message: Message) {
const a = await this.getMods()
return await new PaginatedFieldMessageEmbed()
.setTemplate({ title: 'Test pager embed', color: 0x6080 })
.setItems(a)
.setItemsPerPage(5)
.make()
.run(message)
}
heres my main function of mods command
No description
Solution:
Items need to be valid embed fields because you're using PaginatedFIELDMessageEmbed and fields need a description, title and whether it's inline or not, no other fields. You cannot just insert a random object and expect it to me magically mapped. The error tells you the title is missing and yes it clearly is missing. You should either make a 2 dimensional array of titles and descriptions to ensure every page has an array of proper structure OR use PaginatedMessageEmbed root class and build your own pages with addPageEmbed...
Jump to solution
6 Replies
Favna
Favna15mo ago
What does getMods return
sassan
sassanOP15mo ago
an array of mods
sassan
sassanOP15mo ago
No description
Solution
Favna
Favna15mo ago
Items need to be valid embed fields because you're using PaginatedFIELDMessageEmbed and fields need a description, title and whether it's inline or not, no other fields. You cannot just insert a random object and expect it to me magically mapped. The error tells you the title is missing and yes it clearly is missing. You should either make a 2 dimensional array of titles and descriptions to ensure every page has an array of proper structure OR use PaginatedMessageEmbed root class and build your own pages with addPageEmbed
sassan
sassanOP15mo ago
ah okayy this is a testing debug code to test if its works correctly mb
Favna
Favna15mo ago
No offense but kinda useless. If the class didn't work properly you'd be finding many bug reports here and on GitHub. It's pretty safe to just assume that it does.
Want results from more Discord servers?
Add your server