Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require(`discord.js`);
- const client = new Discord.Client();
- const Enmap = require(`enmap`);
- const farm = new Enmap();
- client.on('ready', () => {
- console.log(`Logged in as ${client.user.tag}!`);
- });
- function randomIntFromInterval(min,max){
- return Math.floor(Math.random()*(max-min+1)+min);
- }
- client.on('message', msg => {
- let ownerid = '349046898562170883';
- if(msg.author.id === ownerid){
- if(msg.content === `farm`){
- if(msg.channel.id !== `512746815712395294`) return;
- let count = 0;
- farm.set(`farm`, 'true')
- setInterval(function(){
- setTimeout(function(){
- if(farm.get(`farm`) !== 'true') return;
- count++;
- msg.channel.send(`${randomIntFromInterval(1135,1234)}${randomIntFromInterval(1135,1334)}${randomIntFromInterval(1135,1534)} #${count}`)
- }, randomIntFromInterval(250, 300))
- }, randomIntFromInterval(1119, 2119))
- }
- if(msg.content.startsWith(`credits`)){
- if(msg.channel.id !== `499698100282195989`) return;
- if(msg.isMentioned(client.user)){
- farm.set(`farm`, 'blah blah')
- let args = msg.content.split(` `)
- msg.channel.send(`#credits <@!${msg.author.id}> ${args[2]}`).then(()=>{
- const filter = m => m.author.id === msg.author.id;
- msg.channel.awaitMessages(filter, {max: 1, time: 29000}).then(col=>{
- if(col.first().content === `cancel`){
- return msg.reply(`Canceled!`);
- }
- msg.channel.send(`${col.first().content}`).then(()=> farm.set(`farm`, 'true'))
- })
- })
- }
- }
- if(msg.content === "stop"){
- if(msg.channel.id !== `512746815712395294`) return;
- msg.reply(`Done!`).then(message=>{
- farm.set(`farm`, `blah blah`)
- })
- }
- }else return;
- });
- client.login(`NDk5Mjg3NTMzNDg2NzM1Mzcw.Dshnsg.N_zPbAco-vsgAPJgcl_StVRqdEI`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement