Exemple #1
0
        public VkCoreApiBase Get(long groupId)
        {
            if (_vkApi.ContainsKey(groupId))
            {
                return(_vkApi[groupId]);
            }
            var api        = new VkCoreApiBase(Core, groupId);
            var accesToken = Core.Configuration.GetValue <string>($"Config:Groups:{groupId}:AccessToken", null);

            if (accesToken == null)
            {
                return(this);
            }
            api.Authorize(new ApiAuthParams {
                AccessToken = accesToken
            });
            _vkApi.Add(groupId, api);
            return(api);
        }
Exemple #2
0
 public MessageHandler(VkCoreApiBase vkApi)
 {
     VkApi = vkApi;
 }
Exemple #3
0
 public Chat(VkCoreApiBase vkApi, long peerId)
 {
     VkApi  = vkApi;
     PeerId = peerId;
 }
Exemple #4
0
 public LogChat(VkCoreApiBase vkApi) : base(vkApi, vkApi.Core.Configuration.GetValue <long>("Config:Log:ChatId", -1))
 {
     MinValue = Enum.Parse <LogValueType>(VkApi.Core.Configuration["Config:Log:MinValue"]);
     MaxValue = Enum.Parse <LogValueType>(VkApi.Core.Configuration["Config:Log:MaxValue"]);
 }