Reputation: 59
Can channel name be used in chat.PostMessage instead of channel Id ? Currently in test setup message is being set even if channel name is passed. Is the feature of sending message to a channel with channel name deprecated ? Or is it still allowed ?
Upvotes: 0
Views: 623
Reputation: 2296
It's indeed possible, but discouraged, to use a channel name with chat.postMessage
. The caution to use is that channel names can change while channel IDs are (usually) forever. You also can't use channel names in most other API method arguments looking for a channel ID. chat.postMessage
is unique this way and just extra helpful in detecting your intent.
Upvotes: 2