set method

void set(
  1. K key,
  2. V value
)

Inserts or replaces data in the collection

Example :

Channel channel = Channel.from({...});
guild.channels.cache.set(channel.id, channel);

Implementation

void set (K key, V value) => this[key] = value;