sono.land
channel
channel
Creating a new channel
The sono.channel is used to create and add a custom channel to the servers Channels list. Creating a channel will allow clients to create specific channels, allowing users to see and send messages only to those that are in the current channel. The channel method takes in a string as an argument which will be the desired name of the channel, and optionally a callback.
Server Side
1const server = serve({ port: 8080 });2const sono = new TestSono();3
4// An example of using channel once an instance of Sono is made5sono.channel('newChannel', () => {6 console.log('new channel created')7})