cant be bothered to enter a commit message

master
Kit Kasune 4 years ago
parent 8b1543304a
commit 92044152bf
  1. 1
      bot.js
  2. 17
      commands/leave.js
  3. 5
      commands/response.js
  4. 34
      commands/secretsanta.js
  5. 17
      commands/welcome.js
  6. 3
      events/guildMemberAdd.js
  7. 3
      events/guildMemberRemove.js
  8. 6
      util/response/sendresponse.js

@ -15,6 +15,7 @@ async function init() {
client.developers = ["330547934951112705", "673477059904929802"]; client.developers = ["330547934951112705", "673477059904929802"];
client.misc = {}; client.misc = {};
client.misc.savers = ['497598953206841375']; client.misc.savers = ['497598953206841375'];
client.misc.activeDMs = new Discord.Collection();
client.utils = {}; client.utils = {};
client.utils.logch = async () => {return client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915');}; client.utils.logch = async () => {return client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915');};

@ -45,5 +45,22 @@ module.exports = {
if (!tr || !tr.bindings.has('leave') || !tr.responses.has(tr.bindings.get('leave'))) {return message.reply("I can't test your leave message because the response doesn't exist, a leave response isn't set, or you haven't made any responses in this server.");} if (!tr || !tr.bindings.has('leave') || !tr.responses.has(tr.bindings.get('leave'))) {return message.reply("I can't test your leave message because the response doesn't exist, a leave response isn't set, or you haven't made any responses in this server.");}
await sendResponse(message.member, message.channel, 'this shit aint matter anymore lol', client, tr.responses.get(tr.bindings.get('leave'))); await sendResponse(message.member, message.channel, 'this shit aint matter anymore lol', client, tr.responses.get(tr.bindings.get('leave')));
} }
if (['clear'].includes(args[0].toLowerCase())) {
tg.lch = '';
tg.save();
let tr = await Responses.findOne({gid: message.guild.id}) ? await Responses.findOne({gid: message.guild.id}) : new Responses({gid: message.guild.id});
if (tr) {
tr.bindings.delete('leave');
tr.save();
}
return message.channel.send(new Discord.MessageEmbed()
.setTitle("Leave Channel/Message Updated")
.setDescription(`This server's leave-notifying settings have been altered by ${message.author.tag}.\n\n**Channel**: None`)
.setColor('c375f0')
.setFooter("Natsuki", client.user.avatarURL())
.setTimestamp()
);
}
} }
}; };

@ -66,6 +66,11 @@ module.exports = {
if (hasBinding) {infoEmbed.addField("Server Bindings", bm);} if (hasBinding) {infoEmbed.addField("Server Bindings", bm);}
return message.channel.send(infoEmbed); return message.channel.send(infoEmbed);
} }
if (['edit', 'e', 'm', 'modify'].includes(args[0].toLowerCase())) {
let options = await getResponse(message, args[1]);
if (!options) {return;}
}
return message.channel.send(`Syntax: \`${prefix}response <new|edit|view|list|delete|test|quick>\``); return message.channel.send(`Syntax: \`${prefix}response <new|edit|view|list|delete|test|quick>\``);

@ -0,0 +1,34 @@
const Discord = require('discord.js');
const ask = require('../util/ask');
module.exports = {
name: "secretsanta",
aliases: ['ss'],
help: new Discord.MessageEmbed()
.setTitle("Help -> Secret Santa")
.setDescription("Create a secret santa for all of your friends or for your server! Whether you celebrate the holidays or not, this can still be loads of fun!")
.addField("Syntax", "``"),
async execute(message, msg, args, cmd, prefix, mention, client) {
if (!args.length) {return message.channel.send(`Syntax: \`${prefix}\``);}
if (['start', 'create', 'new'].includes(args[0].toLowerCase())) {
if (client.misc.activeDMs.has(message.author.id)) {return message.reply("I'm already asking you questions in DM for a separate command! Finish that command before using this one.");}
client.misc.activeDMs.set(message.author.id, 'secretsanta-make');
let mesg = await message.author.send("I'll be asking you a few questions here about how you want your Secret Santa to go! You can simply ignore the messages for a few minutes to cancel the process.").catch(() => {message.reply("Please open your DMs so I can ask you some questions!");});
let dmch = mesg.channel;
let conf = await ask(mesg, "This secret santa will be tied to your account, and you will be considered the host. Is this okay?", 60000); if (!conf) {return;}
if (['n', 'no'].includes(conf.trim().toLowerCase())) {return dmch.send("Oh, alrighty! Have the person who wants to be the host execute this same command.");}
if (!['yes', 'ye', 'y', 'sure'].includes(conf.trim().toLowerCase())) {return dmch.send("Please specify yes or no you weeb!");}
let start = await ask(mesg, "When will you begin the secret santa? (You'll start it manually, so don't worry about formatting.", 60000); if (!start) {return;}
if (start.length > 150) {return dmch.send("Heya there, just a few words, please! I don't wanna have to read out an essay about when it's starting to all the people that want to hear about your secret santa!");}
let end = await ask(mesg, "When will you end the secret santa? (You'll also end it manually.)", 60000); if (!start) {return;}
if (end.length > 150) {return dmch.send("Heya there, just a few words, please! I don't wanna have to read out an essay about when it's ending to all the people that want to hear about your secret santa!");}
let spend = await ask(mesg, "What is your maximum and minimum spending? This is useful so that everyone gets an equal gift or gifts. This will be shown to the people that buy their gifts.", 360000); if (!join) {return;}
}
}
};

@ -45,5 +45,22 @@ module.exports = {
if (!tr || !tr.bindings.has('welcome') || !tr.responses.has(tr.bindings.get('welcome'))) {return message.reply("I can't test your welcome message because the response doesn't exist, a welcome response isn't set, or you haven't made any responses in this server.");} if (!tr || !tr.bindings.has('welcome') || !tr.responses.has(tr.bindings.get('welcome'))) {return message.reply("I can't test your welcome message because the response doesn't exist, a welcome response isn't set, or you haven't made any responses in this server.");}
await sendResponse(message.member, message.channel, 'this shit aint matter anymore lol', client, tr.responses.get(tr.bindings.get('welcome'))); await sendResponse(message.member, message.channel, 'this shit aint matter anymore lol', client, tr.responses.get(tr.bindings.get('welcome')));
} }
if (['clear'].includes(args[0].toLowerCase())) {
tg.wch = '';
tg.save();
let tr = await Responses.findOne({gid: message.guild.id}) ? await Responses.findOne({gid: message.guild.id}) : new Responses({gid: message.guild.id});
if (tr) {
tr.bindings.delete('welcome');
tr.save();
}
return message.channel.send(new Discord.MessageEmbed()
.setTitle("Welcome Channel/Message Updated")
.setDescription(`This server's member-welcoming settings have been altered by ${message.author.tag}.\n\n**Channel**: None`)
.setColor('c375f0')
.setFooter("Natsuki", client.user.avatarURL())
.setTimestamp()
);
}
} }
}; };

@ -12,7 +12,8 @@ module.exports = async (client, member) => {
tr && tr.bindings.has('welcome') && tr.responses.has(tr.bindings.get('welcome')) tr && tr.bindings.has('welcome') && tr.responses.has(tr.bindings.get('welcome'))
&& tg.wch.length && member.guild.channels.cache.has(tg.wch) && tg.wch.length && member.guild.channels.cache.has(tg.wch)
&& member.guild.channels.cache.get(tg.wch).permissionsFor(client.user.id).has("SEND_MESSAGES") && member.guild.channels.cache.get(tg.wch).permissionsFor(client.user.id).has("SEND_MESSAGES")
&& !client.users.cache.get(member.id).bot
) { ) {
member.guild.channels.cache.get(tg.wch).send(await sendResponse(member, member.guild.channels.cache.get(tg.wch), 'xdlol', client, tr.responses.get(tr.bindings.get('welcome')))); try {member.guild.channels.cache.get(tg.wch).send(await sendResponse(member, member.guild.channels.cache.get(tg.wch), 'xdlol', client, tr.responses.get(tr.bindings.get('welcome'))));} catch {}
} }
}; };

@ -9,7 +9,8 @@ module.exports = async (client, member) => {
tr && tr.bindings.has('leave') && tr.responses.has(tr.bindings.get('leave')) tr && tr.bindings.has('leave') && tr.responses.has(tr.bindings.get('leave'))
&& tg.lch.length && member.guild.channels.cache.has(tg.lch) && tg.lch.length && member.guild.channels.cache.has(tg.lch)
&& member.guild.channels.cache.get(tg.lch).permissionsFor(client.user.id).has("SEND_MESSAGES") && member.guild.channels.cache.get(tg.lch).permissionsFor(client.user.id).has("SEND_MESSAGES")
&& !client.users.cache.get(member.id).bot
) { ) {
member.guild.channels.cache.get(tg.lch).send(await sendResponse(member, member.guild.channels.cache.get(tg.lch), 'xdlol', client, tr.responses.get(tr.bindings.get('leave')))); try {member.guild.channels.cache.get(tg.lch).send(await sendResponse(member, member.guild.channels.cache.get(tg.lch), 'xdlol', client, tr.responses.get(tr.bindings.get('leave'))));} catch {}
} }
}; };

@ -10,8 +10,10 @@ module.exports = async(member, channel, mode, client, options) => {
var responseEmbed = new Discord.MessageEmbed().setTitle(options.title).setDescription(await filterResponse(member, client, options.description)); var responseEmbed = new Discord.MessageEmbed().setTitle(options.title).setDescription(await filterResponse(member, client, options.description));
if (options.fieldnames && options.fieldnames.length) {let i; for (i=0;i<options.fieldnames.length;i++) {responseEmbed.addField(options.fieldnames[i], await filterResponse(member, client, options.fieldtexts[i]));}} if (options.fieldnames && options.fieldnames.length) {let i; for (i=0;i<options.fieldnames.length;i++) {responseEmbed.addField(options.fieldnames[i], await filterResponse(member, client, options.fieldtexts[i]));}}
if (options.color) {responseEmbed.setColor(options.color);} if (options.color) {responseEmbed.setColor(options.color);}
if (options.image) {responseEmbed.setImage(options.image);} if (options.image && !options.guildimage) {responseEmbed.setImage(options.image);}
if (options.thumbnail) {responseEmbed.setThumbnail(options.thumbnail);} if (options.guildimage) {responseEmbed.setImage(channel.guild.iconURL({size: 2048}));}
if (options.thumbnail && !options.guildthumb) {responseEmbed.setThumbnail(options.thumbnail);}
if (options.guildthumb) {responseEmbed.setThumbnail(channel.guild.iconURL({size: 1024}));}
} }
if (channel.permissionsFor(client.user.id).has("SEND_MESSAGES")) {return channel.send( if (channel.permissionsFor(client.user.id).has("SEND_MESSAGES")) {return channel.send(
options.message ? await filterResponse(member, client, options.text) : responseEmbed options.message ? await filterResponse(member, client, options.text) : responseEmbed

Loading…
Cancel
Save