Esempio n. 1
0
 public static async Task <IChannel> GetChannelAsync(ulong channelId, [CanBeNull] Client client, params ChannelType[] types)
 {
     client = client ?? DiscordEnvironment.CurrentClient;
     FactoryUtils.ValidateInEnv(client);
     return(await FactoryUtils.GetChannelAsync(_globalCache, "IChannel", null, json => {
         return CreateFromJson(json, null);
     }, (x, json, state) => {
         FactoryUtils.PopulateInstance(x, json, state);
     }, channelId, client, types));
 }
Esempio n. 2
0
 public async Task PullUpdateAsync([CanBeNull] Client client)
 {
     client = client ?? DiscordEnvironment.CurrentClient;
     FactoryUtils.ValidateInEnv(client);
     await FactoryUtils.UpdateAsync(this, null, client.GetChannelJsonAsync, Populate);
 }