How to check message channel

I don’t know how to check message channel id i want if in a channel it can sand something and in another channel it can sand another thing and in other channel it can sand err