How to execute a slash command from inside an addon

I have an addon that works with TitanPanel, Bazooka, etc. It creates a drop down list of options that run slash commands from other addons. I use macrotext, but that broke this past summer. Is it possible to execute a slash command (from another addon) inside my addon? Example: “/bt” opens the bartender options window.
I used to use the following code to run that slash command:
OnClick = function(self, button)
local command_line = ‘/bt’
MacroEditBox:SetText(command_line)
ChatEdit_SendText(MacroEditBox)
end,

Any help would be appreciated.

In the addon(s) there will an associated function in the SlashCmdList table eg,

SlashCmdList["WhateverTheAddonUsesToNameTheSlashCommandFunction"] = function(msg)
    -- code...
end

In this case, you could run the command with:

SlashCmdList["WhateverTheAddonUsesToNameTheSlashCommandFunction"]()

If the addon accepts parameters, just place them inside the () brackets wrapped in quotes eg.

SlashCmdList["WhateverTheAddonUsesToNameTheSlashCommandFunction"]("show")
SlashCmdList["WhateverTheAddonUsesToNameTheSlashCommandFunction"]("hide")

With addon like BarTender that use the AceConsole, you can look for the :RegisterChatCommand code. The slash command will be
ACECONSOLE_ and the uppercase slash command used in-game minus the \ so for BarTender it’s:

SlashCmdList.ACECONSOLE_BT()

or

SlashCmdList["ACECONSOLE_BT"]()

Thank you.
That worked and was very easy to follow.