-
how do i separate reply message after reaching 2000 characters and also able to send markup message with html $discord->listenCommand('list_chapter', function (Interaction $interaction) {
$chapterList = Quran::listChapter();
$list = '';
foreach($chapterList as $chapter) {
$list .= "{$chapter['nomor']}.{$chapter['nama']} - {$chapter['arti']}\n";
}
$interaction->respondWithMessage(MessageBuilder::new()->setContent($list));
}); my listen command looks like this the $list variable contain a lot of character with html markup. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
You can use str_split and then either... |
Beta Was this translation helpful? Give feedback.
-
Message contents are indeed limited to 2000 characters, but if you also use embed, you can put longer description, However it is limited up to 6000 characters for every embed contents Or you can split responses message like @CommandString said, but I suggest avoid using channel send message method. On design notes though, Quran chapters lists are big to display in one page, I suggest you create a paginator (that, having next/previous button), but if the goal is to find & search then select a Quran chapter, i suggest using Interaction command autocomplete, the following is example (Code requires v10/dev-master branch): $discord->listenCommand(['cmd', 'sub', 'int'], function (Interaction $interaction) {
// .. this is interaction action code, when the command is submitted
}, function (Interaction $interaction) use ($discord) {
// .. this is auto complete suggestions, when the option is focused
return [
new Choice($discord, ['name' => 'one', 'value' => 1]),
new Choice($discord, ['name' => 'two', 'value' => 2]),
// ... up to 25
];
}); You need to alter your command and use the builder to set the command Option |
Beta Was this translation helpful? Give feedback.
Message contents are indeed limited to 2000 characters, but if you also use embed, you can put longer description, However it is limited up to 6000 characters for every embed contents
Or you can split responses message like @CommandString said, but I suggest avoid using channel send message method.
On design notes though, Quran chapters lists are big to display in one page, I suggest you create a paginator (that, having next/previous button), but if the goal is to find & search then select a Quran chapter, i suggest using Interaction command autocomplete, the following is example (Code requires v10/dev-master branch):