Beispiel #1
0
 /// <summary>
 /// Returns the configuration of a guild using the specified channel.
 /// </summary>
 /// <param name="channel">The channel.</param>
 /// <returns>The configuration of the guild, or <c>null</c> if the guild cannot be found in the database.</returns>
 public static GuildConfig GetGuildConfig(IMessageChannel channel)
 => channel.IsPrivate() ? null : GetGuildConfig(((IGuildChannel)channel).GuildId);
Beispiel #2
0
 /// <summary>
 /// Returns a cached prefix corresponding to the specified channel.
 /// </summary>
 /// <param name="channel">The channel.</param>
 /// <returns>The cached prefix of the channel.</returns>
 public static string GetCachedPrefix(IMessageChannel channel)
 => channel.IsPrivate() ? CachedGlobalPrefix : PrefixCache.GetValueOrDefault(((IGuildChannel)channel).GuildId, CachedGlobalPrefix) ?? CachedGlobalPrefix;