@@ -9,14 +9,21 @@ import { setMenuOptions } from '@/config/plugins';
99import { t } from '@/i18n' ;
1010
1111import type { MenuContext } from '@/types/contexts' ;
12- import type { DiscordPluginConfig } from './index' ;
12+ import { type DiscordPluginConfig } from './index' ;
1313
1414import type { MenuTemplate } from '@/menu' ;
15+ import { DiscordStatusDisplayType } from './constants' ;
1516
1617const registerRefreshOnce = singleton ( ( refreshMenu : ( ) => void ) => {
1718 discordService ?. registerRefreshCallback ( refreshMenu ) ;
1819} ) ;
1920
21+ const DiscordStatusDisplayTypeLabels = {
22+ [ DiscordStatusDisplayType . YOUTUBE_MUSIC ] : "plugins.discord.menu.set-status-display-type.submenu.youtube-music" ,
23+ [ DiscordStatusDisplayType . ARTIST ] : "plugins.discord.menu.set-status-display-type.submenu.artist" ,
24+ [ DiscordStatusDisplayType . TITLE ] : "plugins.discord.menu.set-status-display-type.submenu.title" ,
25+ }
26+
2027export const onMenu = async ( {
2128 window,
2229 getConfig,
@@ -92,6 +99,19 @@ export const onMenu = async ({
9299 label : t ( 'plugins.discord.menu.set-inactivity-timeout' ) ,
93100 click : ( ) => setInactivityTimeout ( window , config ) ,
94101 } ,
102+ {
103+ label : t ( 'plugins.discord.menu.set-status-display-type.label' ) ,
104+ submenu : Object . values ( DiscordStatusDisplayType ) . map ( ( statusDisplayType ) => ( {
105+ label : t ( DiscordStatusDisplayTypeLabels [ statusDisplayType ] ) ,
106+ type : 'radio' ,
107+ checked : config . statusDisplayType == statusDisplayType ,
108+ click ( ) {
109+ setConfig ( {
110+ statusDisplayType
111+ } ) ;
112+ } ,
113+ } ) ) ,
114+ } ,
95115 ] ;
96116} ;
97117
0 commit comments