Enable Developer Mode in your Discord settings.
Right-click the text channel and select Copy ID.
Copy ID