Why don't you simply just use
Lua Code:
d(message)
--
CHAT_SYSTEM:AddMessage(message)
? and let the chat addons doing their job ? ^^^^^^^^
For your question, it's :
Lua Code:
CHAT_SYSTEM.containers[1]:GetTabName(numTab)
For interested people, send a (fake) message to a category : will display the message where the category is enabled in tab options categories are :
http://wiki.esoui.com/Globals#ChatChannelCategories
This exemple is nice when dislpaying messages for a specific guild per exemple (or the party).
Lua Code:
-- Can occur if event is before EVENT_PLAYER_ACTIVATED
if CHAT_SYSTEM then
if CHAT_SYSTEM.primaryContainer then
CHAT_SYSTEM.primaryContainer:OnChatEvent(nil, displayedMessage, category)
end
end
Writing directly to textbuffer is not a good practice