For message types:
- ChatFrame_AddMessageGroup(ChatFrame1, "GUILD")
- ChatFrame_RemoveMessageGroup(ChatFrame1, "RAID")
For individual numbered channels (eg. trade, general):
- ChatFrame_AddChannel(ChatFrame1, "Trade")
- ChatFrame_RemoveChannel(ChatFrame1, "General")
Note that for both, the first argument must be a reference to the chat frame you want to affect, not a string containing its name.