public void Init(IBot bot, out IMessenger messenger) { var vkOptions = bot.BotOptions.MessengersOptions[VkConstants.Name].Get <VkOptions>(); var api = new VkApi(); api.Authorize(new ApiAuthParams { AccessToken = vkOptions.Token }); api.RequestsPerSecond = 20; DeleteCallbackServer(api, vkOptions); var confirmationCode = AddCallbackServer(api, bot.BotOptions, vkOptions); messenger = new VkMessenger(api, confirmationCode); }
public VkReceiver(IBot bot) { _bot = bot; _messenger = bot.ResolveMessenger(VkConstants.Name) as VkMessenger; }