IRC checking if channel exists

I was simply wondering, (while I suspect it is not possible), if there’s any way to check whether the channel that someone is trying to connect to exists or not.
I currently have an application where the user can enter a channel name in a text box and hit a start button, this will then start to read chat data, however, i was wondering if I could check whether or not said channel exists and alert the user that they are trying to access a channel that doesn’t exist.

I can think of 2 ways…

1.) While joining a channel via IRC, if the channel exists you will join it and receive these raw notices:

← :matt_thomas! JOIN #savage MODE #savage
← 353 matt_thomas = #savage :matt_thomas
← 366 matt_thomas #savage :End of /NAMES list

If you try to join a channel that doesn’t exist then you would stop at: JOIN #derpdddd

Based on that you could have a timer/check for the NAMES or MODE notice within a second or 2, and if it never showed up, notify the use the channel doesn’t exist. This of course requires the user to actually join the channel.

2.) Before executing the JOIN command query the API.

A query to results in:

error: “Not Found”,
status: 404,
message: “Channel ‘derpddd’ does not exist”

Whereas a query for an existing channel like results in:

mature: null,
status: null,
broadcaster_language: null,
display_name: “Savage”,
game: null,
language: “en”,
_id: 11952,
name: “savage”,
created_at: “2007-05-22T10:39:47Z”,
updated_at: “2016-05-11T07:30:24Z”,
delay: null,
logo: null,
banner: null,
video_banner: null,
background: null,
profile_banner: null,
profile_banner_background_color: null,
partner: false,
url: “Twitch”,
views: 874,
followers: 6,
_links: {
self: “”,
follows: “”,
commercial: “”,
stream_key: “”,
chat: “”,
features: “”,
subscriptions: “”,
editors: “”,
teams: “”,
videos: “

Depending on your IRC method, an API call should be fairly easy to implement.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.