Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { Client, RichEmbed, NodeUpos } = require('discord.js');
- const schedule = require('node-schedule');
- const client = new Client();
- client.on('ready', () => {
- console.log(`Logged in as ${client.user.tag}!`);
- // Vier uur, bier uur
- // const date = new Date(2019, 2, 25, 23, 41, 0);
- const date = {hour: 16, minute: 0, dayOfWeek: 5};
- schedule.scheduleJob(date, function() {
- const channel = client.channels.get("266542205563305984");
- // Do nothing if the channel wasn't found on this server
- if (!channel) return;
- // Send the message, mentioning the member
- channel.send('VIER UUR, BIER UUR! @everyone');
- });
- });
- // Bier halen functie
- client.on('message', msg => {
- if (msg.content === 'wie moet er bier halen?') {
- // Get members & remove bots
- let members = Array.from(msg.member.guild.members);
- members = members.filter(function (user) {
- return !user[1].user.bot;
- });
- // Send dm to the lucky one.
- const chosenUser = members[Math.floor(Math.random() * members.length)];
- client.users.get(chosenUser[0]).send("BIER HALEN!").then(function () {
- console.log('Send!');
- });
- // Reply to msg
- msg.reply(chosenUser[1].user.username + ' is de lul!');
- }
- });
- // Create an event listener for new guild members
- client.on('guildMemberAdd', member => {
- // Send the message to a designated channel on a server:
- const channel = member.guild.channels.find(ch => ch.name === 'chat');
- // Do nothing if the channel wasn't found on this server
- if (!channel) return;
- // Send the message, mentioning the member
- channel.send(`Ewa fakka ${member}?`);
- });
- client.login('MzEwNTQwMzA5ODQ0OTgzODA4.D0RKdw.Le0zSvpZpTlfNOI1BA1mPt26MP8');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement