Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. cmd.hear(/^(?:раздача)$/i, async (message, bot) => {
  2. if(message.user.settings.adm < 4) return;
  3. if(giving) return bot(`серьёзно? СЕРЬЁЗНО?! Создавать по 500 постов с раздачей я также не могу. Пойди посмотри канал "Тарелка"`);
  4. giving = true;
  5. vk.api.wall.post({
  6. owner_id: -179960173,
  7. message: `
  8. Новая раздача! КАЖДЫЙ кто сделает РЕПОСТ этой записи получит 500.000BTC, акция действует ровно 12 Часов.`,
  9. attachments: 'photo-179960173_456239043'
  10. }).then((response) => {
  11. vk.api.wall.openComments({
  12. owner_id: -179960173,
  13. post_id: response.post_id
  14. });
  15. vk.api.wall.createComment({
  16. owner_id: -179960173,
  17. post_id: response.post_id,
  18. from_group: 179960173,
  19. message: '* Биткоины будут выданы по окончанию акции, ваш профиль VK должен быть открыт, а то мы не увидим Ваш репост.'
  20. });
  21. vk.api.wall.closeComments({
  22. owner_id: -179960173,
  23. post_id: response.post_id
  24. });
  25. setTimeout(() => {
  26. vk.api.call('wall.getReposts', { owner_id: -179960173, post_id: response.post_id, count: 1000 }).then((res) => {
  27. res.items.map(x=> {
  28. if(x.from_id < 0) return;
  29. let user = users.find(a => a.id === x.from_id);
  30. if(!user) return;
  31. user.btc +=500000;
  32. vk.api.messages.send({ user_id: user.id, message: `Приветик!!!\n\n[id${user.id}|${user.tag}], спасибо за участие в нашей раздаче! Вы получили 500.000BTC ` });
  33. });
  34. });
  35. vk.api.wall.openComments({
  36. owner_id: -179960173,
  37. post_id: response.post_id
  38. });
  39. vk.api.wall.createComment({
  40. owner_id: -179960173,
  41. post_id: response.post_id,
  42. from_group: 179960173,
  43. message: ''
  44. });
  45. vk.api.wall.createComment({
  46. owner_id: -179960173,
  47. post_id: response.post_id,
  48. from_group: 179960173,
  49. message: 'Раздача окончена!'
  50. });
  51. vk.api.wall.closeComments({
  52. owner_id: -179960173,
  53. post_id: response.post_id
  54. });
  55. giving = false;
  56. }, 43200000 );
  57. });
  58. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement