Exemple #1
0
        private static Task SubscribeEventLoggerSettingsBotVar(SocketGuild guild)
        {
            BotVarCollection collection = BotVarManager.GetGuildBotVarCollection(guild.Id);

            collection.SubscribeToBotVarUpdateEvent(EventLogger.OnBotVarUpdatedGuild, "logChannels");
            return(Task.CompletedTask);
        }
 internal static void SubscribeToBotVarCollection(BotVarCollection botVarCollection)
 {
     if (botVarCollection != BotVarManager.GlobalBotVars)
     {
         botVarCollection.SubscribeToBotVarUpdateEvent(OnBotVarUpdatedGuild, "logChannels");
         if (botVarCollection.TryGetBotVar("logChannels", out EventLoggerSettings settings))
         {
             GuildEventLoggerSettings[botVarCollection.GuildID] = settings;
         }
     }
 }
 public static GuildChannelMeta GetDefault(ulong guildId)
 {
     if (!guildDefaults.TryGetValue(guildId, out GuildChannelMeta guildDefault))
     {
         BotVarCollection guildBotVarCollection = BotVarManager.GetGuildBotVarCollection(guildId);
         if (!guildBotVarCollection.TryGetBotVar("defaultguildchannelmeta", out guildDefault))
         {
             guildDefault = new GuildChannelMeta();
         }
         guildDefaults.Add(guildId, guildDefault);
         guildBotVarCollection.SubscribeToBotVarUpdateEvent(OnBotVarUpdated, "defaultguildchannelmeta");
     }
     return(guildDefault);
 }