@@ -29,20 +29,33 @@ export const hideSendCommand = () => ({
2929 const media = interaction . options . get ( rosetty . t ( 'hideSendCommandOptionMedia' ) ! ) ?. attachment ?. proxyURL ;
3030 let mediaContentType = interaction . options . get ( rosetty . t ( 'sendCommandOptionMedia' ) ! ) ?. attachment ?. contentType ;
3131 let mediaDuration = interaction . options . get ( rosetty . t ( 'sendCommandOptionMedia' ) ! ) ?. attachment ?. duration ;
32+ let mediaIsShort = false ;
3233
3334 let additionalContent ;
3435 if ( ( ! mediaContentType || ! mediaDuration ) && ( media || url ) ) {
3536 additionalContent = await getContentInformationsFromUrl ( ( media || url ) as string ) ;
3637 }
3738
38- if ( mediaContentType === null && additionalContent ?. contentType ) {
39+ if ( ( mediaContentType === undefined || mediaContentType === null ) && additionalContent ?. contentType ) {
3940 mediaContentType = additionalContent . contentType ;
4041 }
4142
42- if ( mediaDuration === null && additionalContent ?. mediaDuration ) {
43+ if ( mediaContentType ?. startsWith ( 'video/' ) ) {
44+ const height = interaction . options . get ( rosetty . t ( 'sendCommandOptionMedia' ) ! ) ?. attachment ?. height ;
45+ const width = interaction . options . get ( rosetty . t ( 'sendCommandOptionMedia' ) ! ) ?. attachment ?. width ;
46+ if ( height && width ) {
47+ mediaIsShort = height > width ;
48+ }
49+ }
50+
51+ if ( ( mediaDuration === undefined || mediaDuration === null ) && additionalContent ?. mediaDuration ) {
4352 mediaDuration = additionalContent . mediaDuration ;
4453 }
4554
55+ if ( additionalContent ?. mediaIsShort ) {
56+ mediaIsShort = additionalContent . mediaIsShort || false ;
57+ }
58+
4659 await prisma . queue . create ( {
4760 data : {
4861 content : JSON . stringify ( {
@@ -55,6 +68,7 @@ export const hideSendCommand = () => ({
5568 interaction . guildId ! ,
5669 ) ,
5770 displayFull : await getDisplayMediaFullFromGuildId ( interaction . guildId ! ) ,
71+ mediaIsShort,
5872 } ) ,
5973 type : QueueType . MESSAGE ,
6074 discordGuildId : interaction . guildId ! ,
0 commit comments