discord.js分页嵌入



所以基本上我有一系列的物品:[苹果、香蕉、桃子、梨、椰子、橙子…等等]

我想在嵌入中显示它们,但由于嵌入有字符限制,我希望每页只显示10个元素,每当用户使用箭头表情符号做出反应时,就会将它们带到另一个页面,所以基本上是对嵌入进行分页。但无论我尝试了多少种方法,我似乎都做不到——非常感谢帮助!

p.S-我删除了我的代码,因为我无法提供代码-好吧,我的代码无论如何都不会有任何帮助-

我建议使用discord.js-分页模块。它允许您提供一个嵌入数组,然后处理所有困难的东西。

const pagination = require('discord.js-pagination');
// array of the embeds to send
// The embeds cannot have footers as the module adds the page number here.
const pages = [
new MessageEmbed().setTitle('1'),
new MessageEmbed().setTitle('2'),
new MessageEmbed().setTitle('3'),
]
// basic usage
pagination (msg, pages);

最新更新