function select_other() {
  let channel_list = client.channels
    .array()
    .filter(c => c.type === "group" || c.type === "dm")
    .sort((a, b) => {
      if (a.lastMessageID < b.lastMessageID) {
        return 1;
      }
      if (a.lastMessageID > b.lastMessageID) {
        return -1;
      }
      return 0;
    });
  let channel_names = channel_list.map(c =>
    c.type === "dm"
      ? c.recipient.username
      : c.recipients
          .array()
          .map(r => r.username)
          .join()
  );

  return channel_list[select_item(channel_names)];
}
// sets the channel to a dm or gm channel
sets the channel to a dm or gm channel
sets the channel to a dm or gm channel
function select_other() {
  let channel_list = client.channels
    .array()
    .filter(c => c.type === "group" || c.type === "dm")
    .sort((a, b) => {
      if (a.lastMessageID < b.lastMessageID) {
        return 1;
      }
      if (a.lastMessageID > b.lastMessageID) {
        return -1;
      }
      return 0;
    });
  let channel_names = channel_list.map(c =>
    c.type === "dm"
      ? c.recipient.username
      : c.recipients
          .array()
          .map(r => r.username)
          .join()
  );
  return channel_list[select_item(channel_names)];
}
function select_other ( ) { let channel_list = client . channels . array ( ) . filter ( c => c . type === "group" || c . type === "dm" ) . sort ( ( a , b ) => { if ( a . lastMessageID < b . lastMessageID ) { return 1 ; } if ( a . lastMessageID > b . lastMessageID ) { return - 1 ; } return 0 ; } ) ; let channel_names = channel_list . map ( c => c . type === "dm" ? c . recipient . username : c . recipients . array ( ) . map ( r => r . username ) . join ( ) ) ; return channel_list [ select_item ( channel_names ) ] ; }
sets the channel to a dm or gm channel
sets the channel to a dm or gm channel