Why are there two arguments to getMenuForIndex?


getMenuForIndex gives you a topLevelMenuIndex as an int, and menuName as a String. All the examples I can find seem to use the topLevelMenuIndex, so why is there the menuName option?

Sorry if this is obvious, but I’m trying to wrap my head around menus and ApplicationCommandManagers.


It’s just there so you can use either the name or the index to work out which menu is wanted. True, it’s probably not necessary, but it’s just thrown in in case it’s useful.