Esempio n. 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);
        }
Esempio n. 2
0
 public MessageHandler(VkCoreApiBase vkApi)
 {
     VkApi = vkApi;
 }
Esempio n. 3
0
 public Chat(VkCoreApiBase vkApi, long peerId)
 {
     VkApi  = vkApi;
     PeerId = peerId;
 }
Esempio n. 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"]);
 }