module.exports = (lib) => {
  lib.trigger.add({
    name: 'join',
    call: /^!join (#.*)/i,
    level: 100,
    active: 1,
    func: (e) => {
      let args = e.message.split(' ');
      args.shift();
      var joins = [];
      args.forEach(channel => {
        channel = channel.trim();
        if(channel.charAt(0) === "#") {
          joins.push(channel);
        }
      });
      lib.bot.join(joins, e.network);
      e.reply("joined channels: "+joins.join(", "));
    },
    desc: 'join channel'
  });
};