Closed Ariana1729 closed 4 years ago
I think it shouldn't be too hard to add a command to change bitrates instead, and possibly append like (##kbps)
async bitrate (message) {
let args = message.split(' ').splice(1).filter(str => str!=="")
let mem = message.member
let channel = message.member.voiceChannel
if (channel == null) {
throw new Error(`<@${message.author.id}>! You aren't in a voice channel`)
}
if (args.length == 0) {
selfDestructMessage(() => message.reply(`<#${channel.id}> bitrate: ` + channel.bitrate))
} else {
if (isNanN(args[0])) {
throw new Error(`<@${message.author.id}>! Input is not a valid bitrate(i.e. 64000)`)
}
let guildInfo = await this.client.guildRepository.load(message.guild.id)
if (!guildInfo.permitted_channels.includes(channel.id)) {
throw new Error(`<@${message.author.id}>! Not a valid voice channel`)
}
let newrate = parseInt(args[0])
channel.bitrate = newrate
channel.name += channel.name.replace(/\([0-9]+kbps\)$/,'('+newrate/1000+'kbps)')
}
}
i suppose for a bitrate command something like this should suffice? also removes the need for extra the 64kbps rooms
We'd probably want to make sure that the calling user actually had the room locked, but something like that, yes. (It would also save us needing to check if the channel was on the permitted channels list, because only permitted channels can be locked.)
i guess could also remove the initial commit?
(need to rework the autovc creation also)
hopefully, sometimes the 2 rooms does fill up