Andrey0189

Untitled

Jun 8th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let welcome
  2.  
  3. let p = '-'
  4. let helper = '452378419917750274'
  5. let devel = '452377533183426562'
  6. let tester = '452386855367737354'
  7. let one = '<:oneEmoji:451337518915387402>';
  8. let two = '<:twoEmoji:451337620589379586>';
  9. let three = '<:threeEmoji:451337648296951813>';
  10. let five = '<:fiveEmoji:451337693973053452>';
  11. let four = '<:fourEmoji:451337671818739713>';
  12.  
  13. //Функции
  14.  
  15. function randomInteger(min, max) {
  16.     return Math.floor(Math.random() * (max - min)) + min;
  17. }
  18.  
  19. async function multipleReact(message, arr) {
  20.     if (arr !== []) {
  21.         await message.react(arr.shift()).catch(console.error).then(function () {multipleReact(message,arr).catch();});
  22.     }
  23. }
  24.  
  25. bot.on('ready', () => {
  26.     bot.user.setActivity('БОТ ОБНОВЛЯЕТСЯ! НЕ ЮЗАТЬ МЕНЯ!',{ type: 'PLAYING' })
  27.     console.log('Welcome to Mac OS!');
  28. });
  29.  
  30. bot.on('guildCreate', (guild) => {
  31.     let channels = guild.channels.filter(channel => channel.type === 'text' && channel.permissionsFor(guild.members.get(bot.user.id)).has('SEND_MESSAGES'));
  32. if (channels.size > 0) channels.first().send('Welcome to Mac OS 2.0! Thank you all for choosing my bot. If you want to use me, you need write the command -settings! Добро пожаовать в Mac OS 2.0! Спасибо, что выбрали нашего бота. Вы **лучшие**!. Для того чтобы начать мной пользоваться напишите команду -settings! Also, join my server! https://discord.gg/2P9mukc');
  33.     });
  34.  
  35. bot.on('message', (message) => {
  36.     if (message.channel.type !== 'text') return;
  37.     if (message.author.bot) return;
  38.     if(message.content.indexOf(p) !== 0) return;
  39.     const args = message.content.slice(p.length).trim().split(/ +/g);
  40.     const vote = message.content.slice(p.length).trim().split(/\|+/g);
  41.     const command = args.shift().toLowerCase();
  42.  
  43.    
  44.     if(['s'].includes(command)) {
  45.         message.channel.send('First, you need to choose a language. Write rus/eng').then(() => {
  46.             const collector = new Discord.MessageCollector(message.channel, m => m.author.id === message.author.id, { time: 60000 });
  47.             collector.on('collect', msg => {
  48.                 collector.stop();
  49.                 let lang
  50.                 if (msg.content == 'rus') {
  51.                     lang = 'rus'
  52.                     message.channel.send('Теперь я буду говорить на русском');
  53.                 }
  54.                 else if (msg.content == 'eng') {
  55.                     message.channel.send('Now I`ll talk on english language');
  56.                     lang = 'eng'
  57.                 }
  58.                 else {
  59.                     message.channel.send('Sorry, but I don`t support this language');
  60.                 }
  61.                 collector.on('end', msg => {
  62.                     message.channel.send('ghbdtn');
  63.                     message.channel.send(lang);
  64.                     let prefixQuestion
  65.                     let noArgsInPerfix
  66.                     let myPrefix
  67.                     if (lang === 'rus') {
  68.                         prefixQuestion = 'Теперь, вам нужно выбрать префикс. Примеры префиксов: `!` `;` `=` `-` `)` `>`. Для префикса нежелательно использовать буквы или использовать более трех символов. Напишите `prefix: сам префикс` внизу. Обязательно через пробел!';
  69.                         noArgsInPerfix = 'Вы не указали префикс'
  70.                         myPrefix = 'Теперь мой новый префикс - `'
  71.                         message.channel.send(prefixQuestion + noArgsInPerfix + myPrefix);
  72.                     } else if (lang === 'eng') {
  73.                         prefixQuestion = 'Now you need to choose prefix. Examples of prefixs: `!` `;` `=` `-` `)` `>`. Dont use letters or more than 3 symbols. Writeм `prefix: prefix` under the message'
  74.                         noArgsInPerfix = 'You did not write a prefix'
  75.                         myPrefix = 'Now my new prefix is - `'
  76.                         message.channel.send(prefixQuestion + noArgsInPerfix + myPrefix);
  77.                     }
  78.                 })
  79.             }
  80.         )}
  81.     )}
  82. })
Advertisement
Add Comment
Please, Sign In to add comment