Plugin Author
Nicola Mustone
(@nicolamustone)
Automattic Happiness Engineer
Hi @zoomah,
I’m not sure I can fully help you here.
While it works perfect to send Just text to Discord, i’d like to send the content of the textbox as is.
Tha’s exactly what the plugin does. If you define a custom message format in the Settings it sends it as is without escaping anything. The escape is done by Discord.
I’d also request %post_content% which should be cut to 2048 chars.
You can do this with the filter wp_discord_post_post_content. Something like this in your functions.php file would work:
add_filter( 'wp_discord_post_post_content', 'wp_discord_post_content_length' );
function wp_discord_post_content_length( $content ) {
if ( strlen( $content ) > 2048 ) {
$content = substr( $content, 0, 2048 );
}
return $content;
}
Thread Starter
zoomah
(@zoomah)
I’ll look into it… The escapes for the mention come from a lot of html_escapes in your code, tho… might bring out my php skills and change it directly … hum
because if i try to send <@&453685191131660290> it arrives like this: https://i.imgur.com/L4k3Uko.png and thats not recogniced as group-mention by discord.
And thanks for explaining how to set up the filter thingy… just need to find out how to add more tags tho… is there a documentation about that $post that goes into the function? 🙂
-
This reply was modified 7 years, 11 months ago by
zoomah.
-
This reply was modified 7 years, 11 months ago by
zoomah.
-
This reply was modified 7 years, 11 months ago by
zoomah.
Thread Starter
zoomah
(@zoomah)
I made a personal copy and changed a few things. Works like a charm now AND i can drop embeds into the chat 🙂
Plugin Author
Nicola Mustone
(@nicolamustone)
Automattic Happiness Engineer
Awesome! Would you mind sharing your changes for others to benefit too?
Thanks!