kitUIN / ChatImage

A Minecraft Mod Which Could Show Image In Chat Line
https://chatimage.kituin.fun
32 stars 5 forks source link

Not stripping url arguments for discord images #51

Open oskarbukovsky opened 2 months ago

oskarbukovsky commented 2 months ago

It looks like chatimage ignore parameters in url and for discord images it doesnt work image

kitUIN commented 2 months ago

could you give me raw url?

oskarbukovsky commented 1 month ago

Examples:

image https://media.discordapp.net/attachments/1243302804802633728/1263505132276940860/image.png?ex=669a7a5a&is=669928da&hm=9ee4b06fc189006b7a81e9730649a4cea750cc87d12149ec18008466c5431512&=&format=webp&quality=lossless

image https://cdn.discordapp.com/attachments/1243302804802633728/1263506347371135048/IMG_20240718_164152.jpg?ex=669a7b7c&is=669929fc&hm=05e84327f7171b3ce5fe3b5c42e1ecc7a74bc50988228faef40e8a75e6b08cf4&

image

image The last is a result of /chatimage url https://media.discordapp.net/attachments/1243302804802633728/1263505132276940860/image.png?ex=669a7a5a&is=669928da&hm=9ee4b06fc189006b7a81e9730649a4cea750cc87d12149ec18008466c5431512&=&format=webp&quality=lossless

kitUIN commented 1 month ago

minecraft version is ?

also,we don't support .webp image

oskarbukovsky commented 1 month ago

Minecraft 1.20.1 Forge 47.3.1 ChatImage 1.2.4+1.20.1+forge

Ok, but one is .jpg, also why not?

kitUIN commented 1 month ago

now, not support url with parameters a better way is to use CICode maybe it has a bug

oskarbukovsky commented 1 month ago

Any chance to adding suport for parameters to mod? We are using discordsrv and it will be super cool to not switch windows and enjoy image content ingame.

kitUIN commented 1 month ago

It is very difficult to determine the valid length of the url when the url with parameters is in a sentence.

A better way is for discordsrv to support CICode usage

oskarbukovsky commented 1 month ago

Why just not to look at url as one word from http/etc. and try first if it is a valid image response else use current behavior?

oskarbukovsky commented 1 month ago

I'll try to make feature suggestion od discordsrv github, but i think not that much people will use CICode functionality. So probably time to find some workaround on discord to download and upload images elsewhere and send link to them into channel as bot, idk :(

//Why am i stupid, it will not help on discordsrv supporting cicode

kitUIN commented 1 month ago

I'll try to implement a url with parameters

oskarbukovsky commented 2 weeks ago

After 2 days learning discordjs from scratch, it's working what i needed 😅 Such a pain, but good excuse to learn something new