File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,17 @@ export function formatTime(ms: number): string {
5858export async function setVoiceStatus (
5959 client : Lavamusic ,
6060 channelId : string ,
61- message : string ,
61+ message : string | null ,
6262) : Promise < void > {
63- if ( ! channelId || ! message ) return ;
63+ if ( ! channelId ) return ;
64+
65+ // string => set | null / "" => clear
66+ const status = message && message . trim ( ) . length > 0 ? message : null ;
6467
6568 try {
66- await client . rest . put ( `/channels/${ channelId } /voice-status` , { body : { status : message } } ) ;
69+ await client . rest . put ( `/channels/${ channelId } /voice-status` , {
70+ body : { status } ,
71+ } ) ;
6772 } catch ( error ) {
6873 logger . error ( `[Voice Status] Failed for channel ${ channelId } : ${ error } ` ) ;
6974 }
You can’t perform that action at this time.
0 commit comments