Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmd.hear(/^(?:раздача)$/i, async (message, bot) => {
- if(message.user.settings.adm < 4) return;
- if(giving) return bot(`серьёзно? СЕРЬЁЗНО?! Создавать по 500 постов с раздачей я также не могу. Пойди посмотри канал "Тарелка"`);
- giving = true;
- vk.api.wall.post({
- owner_id: -179960173,
- message: `
- Новая раздача! КАЖДЫЙ кто сделает РЕПОСТ этой записи получит 500.000BTC, акция действует ровно 12 Часов.`,
- attachments: 'photo-179960173_456239043'
- }).then((response) => {
- vk.api.wall.openComments({
- owner_id: -179960173,
- post_id: response.post_id
- });
- vk.api.wall.createComment({
- owner_id: -179960173,
- post_id: response.post_id,
- from_group: 179960173,
- message: '* Биткоины будут выданы по окончанию акции, ваш профиль VK должен быть открыт, а то мы не увидим Ваш репост.'
- });
- vk.api.wall.closeComments({
- owner_id: -179960173,
- post_id: response.post_id
- });
- setTimeout(() => {
- vk.api.call('wall.getReposts', { owner_id: -179960173, post_id: response.post_id, count: 1000 }).then((res) => {
- res.items.map(x=> {
- if(x.from_id < 0) return;
- let user = users.find(a => a.id === x.from_id);
- if(!user) return;
- user.btc +=500000;
- vk.api.messages.send({ user_id: user.id, message: `Приветик!!!\n\n[id${user.id}|${user.tag}], спасибо за участие в нашей раздаче! Вы получили 500.000BTC ` });
- });
- });
- vk.api.wall.openComments({
- owner_id: -179960173,
- post_id: response.post_id
- });
- vk.api.wall.createComment({
- owner_id: -179960173,
- post_id: response.post_id,
- from_group: 179960173,
- message: ''
- });
- vk.api.wall.createComment({
- owner_id: -179960173,
- post_id: response.post_id,
- from_group: 179960173,
- message: 'Раздача окончена!'
- });
- vk.api.wall.closeComments({
- owner_id: -179960173,
- post_id: response.post_id
- });
- giving = false;
- }, 43200000 );
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement