Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="optionKey"></param>
        /// <param name="options"></param>
        public static void AddOrReplaceOption(string optionKey, TelegramBotOptions options)
        {
            if (Options.ContainsKey(optionKey))
            {
                Options[optionKey] = options;
                return;
            }

            Options.Add(optionKey, options);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="optionKey"></param>
        public static TelegramBotOptions GetOptions(string optionKey)
        {
            if (Options.TryGetValue(optionKey, out var options))
            {
                return(options);
            }

            options = new TelegramBotOptions();
            AddOrReplaceOption(optionKey, options);

            return(options);
        }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="defaultOptions"></param>
 public static void SetDefautOptions(TelegramBotOptions defaultOptions)
 {
     AddOrReplaceOption(DefaultOptions, defaultOptions);
 }