tmijs / tmi.js

💬 Javascript library for the Twitch Messaging Interface. (Twitch.tv)
https://tmijs.com
MIT License
1.55k stars 214 forks source link

Fix part() not processing channel name #552

Open a-random-lemurian opened 10 months ago

a-random-lemurian commented 10 months ago

part(channel) is not properly processing channel names before sending PART commands to Twitch, resulting in PARTs failing to go through. This pull request will add the missing call to _.channel() ensuring that client.part('a_random_lemurian') (note the missing #) works just like client.part('#a_random_lemurian').

part(channel) {
    channel = _.channel() // This line of code should have been added
    return this._sendCommand({ delay: null, channel: null, command: `PART ${channel}` }, (res, rej) =>
        this.once('_promisePart', err => !err ? res([ _.channel(channel) ]) : rej(err))
    );
}