Compare commits
No commits in common. "f5f7b489352d870033e9601aad4edfd97393290a" and "983bfcfc9e1c988a44c550025dd090a4315dcbce" have entirely different histories.
f5f7b48935
...
983bfcfc9e
7 changed files with 21 additions and 101 deletions
|
@ -24,10 +24,9 @@ export default {
|
||||||
const member = args.user;
|
const member = args.user;
|
||||||
const message = args.message;
|
const message = args.message;
|
||||||
const attachment = args.image;
|
const attachment = args.image;
|
||||||
const username = member.nickname ? member.nickname : member.user.username;
|
|
||||||
|
|
||||||
const webhook = await interaction.channel.createWebhook({
|
const webhook = await interaction.channel.createWebhook({
|
||||||
name: username,
|
name: member.user.username,
|
||||||
avatar: member.user.displayAvatarURL(),
|
avatar: member.user.displayAvatarURL(),
|
||||||
reason: `Fakebot/user command triggered by: ${interaction.user.username}`,
|
reason: `Fakebot/user command triggered by: ${interaction.user.username}`,
|
||||||
});
|
});
|
||||||
|
@ -38,12 +37,6 @@ export default {
|
||||||
await webhook.send({ content: message });
|
await webhook.send({ content: message });
|
||||||
}
|
}
|
||||||
await webhook.delete(`Fakebot/user command triggered by: ${interaction.user.username}`);
|
await webhook.delete(`Fakebot/user command triggered by: ${interaction.user.username}`);
|
||||||
if (interaction.isMessage) {
|
await interaction.editReply({ content: `Faked the user ${member}` });
|
||||||
await interaction.delete();
|
|
||||||
await interaction.deleteReply();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
await interaction.editReply({ content: `Faked the user ${member}` });
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -176,7 +176,7 @@ export default {
|
||||||
|
|
||||||
const Embed = new EmbedBuilder()
|
const Embed = new EmbedBuilder()
|
||||||
.setAuthor({ name: interaction.user.username, iconURL: interaction.user.displayAvatarURL() })
|
.setAuthor({ name: interaction.user.username, iconURL: interaction.user.displayAvatarURL() })
|
||||||
.setDescription(tweet ? tweet : 'No content.')
|
.setDescription(tweet)
|
||||||
.addFields(
|
.addFields(
|
||||||
{ name: 'Link', value: TweetLink, inline: true },
|
{ name: 'Link', value: TweetLink, inline: true },
|
||||||
{ name: 'Tweet ID', value: tweetid, inline: true },
|
{ name: 'Tweet ID', value: tweetid, inline: true },
|
||||||
|
|
|
@ -3,6 +3,9 @@ import fs from 'node:fs';
|
||||||
import os from 'node:os';
|
import os from 'node:os';
|
||||||
import YTPGenerator from 'ytpplus-node';
|
import YTPGenerator from 'ytpplus-node';
|
||||||
|
|
||||||
|
const { prefix } = process.env;
|
||||||
|
const prefixs = prefix.split(',');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName('ytp')
|
.setName('ytp')
|
||||||
|
@ -13,7 +16,7 @@ export default {
|
||||||
.setRequired(false)),
|
.setRequired(false)),
|
||||||
category: 'fun',
|
category: 'fun',
|
||||||
async execute(interaction, args) {
|
async execute(interaction, args) {
|
||||||
if (!interaction.channel.nsfw && !args.force) return interaction.reply(`Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry ) OR do \`\`${interaction.prefix}ytp --force\`\` to make the command work outside of nsfw channel BE AWARE THAT IT WON'T CHANGE THE FINAL RESULT SO NSFW CAN STILL HAPPEN`);
|
if (!interaction.channel.nsfw && !args.force) return interaction.reply(`Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry ) OR do \`\`${prefixs[0]}ytp --force\`\` to make the command work outside of nsfw channel BE AWARE THAT IT WON'T CHANGE THE FINAL RESULT SO NSFW CAN STILL HAPPEN`);
|
||||||
|
|
||||||
// Read userVid folder and select random vid and only take .mp4
|
// Read userVid folder and select random vid and only take .mp4
|
||||||
const mp4 = [];
|
const mp4 = [];
|
||||||
|
|
|
@ -1,68 +0,0 @@
|
||||||
import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
|
|
||||||
// const feedbackID = [];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
data: new SlashCommandBuilder()
|
|
||||||
.setName('dm')
|
|
||||||
.setDescription('Replies with Pong!')
|
|
||||||
.addStringOption(option =>
|
|
||||||
option.setName('userid')
|
|
||||||
.setDescription('The user to who you want to send the message to.')
|
|
||||||
.setRequired(true))
|
|
||||||
.addStringOption(option =>
|
|
||||||
option.setName('message')
|
|
||||||
.setDescription('What do you want to tell them?')
|
|
||||||
.setRequired(true))
|
|
||||||
.addAttachmentOption(option =>
|
|
||||||
option.setName('image')
|
|
||||||
.setDescription('Optional attachment.')
|
|
||||||
.setRequired(false)),
|
|
||||||
category: 'owner',
|
|
||||||
async execute(interaction, args, client) {
|
|
||||||
/* Too lazy to implement that now (Watch it rest untouched for months)
|
|
||||||
async function uuidv4() {
|
|
||||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
|
||||||
const r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
|
||||||
return v.toString(16);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const uuid = uuidv4();
|
|
||||||
feedbackID[uuid] = args.message;
|
|
||||||
*/
|
|
||||||
await client.users.fetch(args.userid);
|
|
||||||
const user = client.users.resolve(args.userid);
|
|
||||||
if (!user) return interaction.reply('Not a valid ID');
|
|
||||||
const text = args.message;
|
|
||||||
|
|
||||||
const Embed = new EmbedBuilder()
|
|
||||||
.setTitle('You received a message from the developer!')
|
|
||||||
.setDescription(text)
|
|
||||||
.setFooter({ text: `If you wish to respond use the following command: ${interaction.prefix}feedback <message>` })
|
|
||||||
.setTimestamp();
|
|
||||||
|
|
||||||
user.send({ embeds: [Embed] });
|
|
||||||
return interaction.reply({ content: `DM sent to ${user.username}`, ephemeral: true });
|
|
||||||
/*
|
|
||||||
const Attachment = (message.attachments).array();
|
|
||||||
if (Attachment[0]) {
|
|
||||||
client.users.resolve(user).send(Embed, { files: [Attachment[0].url] })
|
|
||||||
.then(() => {
|
|
||||||
return interaction.reply(`DM sent to ${user.username}`);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
return interaction.reply(`Could not send a DM to ${user.username}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
client.users.resolve(user).send(Embed)
|
|
||||||
.then(() => {
|
|
||||||
return interaction.reply(`DM sent to ${user.tag}`);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
return interaction.reply(`Could not send a DM to ${user.tag}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
},
|
|
||||||
};
|
|
|
@ -25,7 +25,7 @@ export default {
|
||||||
const client = interaction.client;
|
const client = interaction.client;
|
||||||
const command = args.command;
|
const command = args.command;
|
||||||
const userid = args.userid;
|
const userid = args.userid;
|
||||||
const reason = args.reason ? args.reason : 'No reason has been specified.';
|
const reason = args.reason;
|
||||||
|
|
||||||
const blacklist = await Blacklists.findOne({ where: { type:command, uid:userid } });
|
const blacklist = await Blacklists.findOne({ where: { type:command, uid:userid } });
|
||||||
|
|
||||||
|
@ -33,11 +33,12 @@ export default {
|
||||||
const body = { type:command, uid: userid, reason: reason };
|
const body = { type:command, uid: userid, reason: reason };
|
||||||
Blacklists.create(body);
|
Blacklists.create(body);
|
||||||
let user = userid;
|
let user = userid;
|
||||||
await client.users.fetch(userid);
|
if (command !== 'guild') {
|
||||||
user = client.users.resolve(userid).tag;
|
await client.users.resolve(userid);
|
||||||
|
user = client.users.fetch(userid).tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
return interaction.editReply(`${user} has been blacklisted from ${command} with the following reason ${reason}`);
|
||||||
return interaction.editReply(`${user} has been blacklisted from ${command} with the following reason \`${reason}\``);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const row = new ActionRowBuilder()
|
const row = new ActionRowBuilder()
|
||||||
|
@ -56,7 +57,7 @@ export default {
|
||||||
|
|
||||||
await interaction.editReply({ content: 'This user is already blacklisted, do you want to unblacklist him?', ephemeral: true, components: [row] });
|
await interaction.editReply({ content: 'This user is already blacklisted, do you want to unblacklist him?', ephemeral: true, components: [row] });
|
||||||
|
|
||||||
interaction.client.once('interactionCreate', async (interactionMenu) => {
|
interaction.client.on('interactionCreate', async (interactionMenu) => {
|
||||||
if (interaction.user !== interactionMenu.user) return;
|
if (interaction.user !== interactionMenu.user) return;
|
||||||
if (!interactionMenu.isButton) return;
|
if (!interactionMenu.isButton) return;
|
||||||
interactionMenu.update({ components: [] });
|
interactionMenu.update({ components: [] });
|
||||||
|
|
|
@ -75,8 +75,6 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interaction.prefix = '/';
|
|
||||||
|
|
||||||
const args = {};
|
const args = {};
|
||||||
// https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandOptionType
|
// https://discord-api-types.dev/api/discord-api-types-v10/enum/ApplicationCommandOptionType
|
||||||
interaction.options.data.forEach(arg => {
|
interaction.options.data.forEach(arg => {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Make this shit work.
|
* Make this shit work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
|
import { EmbedBuilder, PermissionFlagsBits } from 'discord.js';
|
||||||
import db from '../../models/index.js';
|
import db from '../../models/index.js';
|
||||||
import { rand } from '../../utils/rand.js';
|
import { rand } from '../../utils/rand.js';
|
||||||
const ratelimit = {};
|
const ratelimit = {};
|
||||||
|
@ -337,7 +337,6 @@ export default {
|
||||||
}
|
}
|
||||||
message.user = message.author;
|
message.user = message.author;
|
||||||
message.isMessage = true;
|
message.isMessage = true;
|
||||||
message.prefix = `${messageArray[0]} `;
|
|
||||||
|
|
||||||
let waitingmsg;
|
let waitingmsg;
|
||||||
const toDelete = [];
|
const toDelete = [];
|
||||||
|
@ -369,23 +368,15 @@ export default {
|
||||||
msg.delete();
|
msg.delete();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const args = {};
|
const args = {};
|
||||||
|
|
||||||
const argsLength = command.data.options.length;
|
const argsLength = command.data.options.length;
|
||||||
|
|
||||||
command.data.options.forEach(obj => {
|
|
||||||
if (obj.type === ApplicationCommandOptionType.Attachment) {
|
|
||||||
args[obj.name] = message.attachments.first();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
for (let i = 0, j = 0; i < argsLength; i++, j++) {
|
for (let i = 0, j = 0; i < argsLength; i++, j++) {
|
||||||
if (!messageArgs[i]) continue;
|
if (!messageArgs[i]) continue;
|
||||||
const arg = command.data.options[j];
|
const arg = command.data.options[j];
|
||||||
if (arg.type === ApplicationCommandOptionType.Attachment) continue;
|
const type = arg.constructor.name.toLowerCase();
|
||||||
let payloadName = arg.name;
|
let payloadName = arg.name;
|
||||||
let payload = messageArgs[i];
|
let payload = messageArgs[i];
|
||||||
|
|
||||||
if (i >= argsLength - 1) {
|
if (i >= argsLength - 1) {
|
||||||
payload = messageArgs.slice(i).join(' ');
|
payload = messageArgs.slice(i).join(' ');
|
||||||
}
|
}
|
||||||
|
@ -395,11 +386,13 @@ export default {
|
||||||
payload = true;
|
payload = true;
|
||||||
j--;
|
j--;
|
||||||
}
|
}
|
||||||
|
else if (type.includes('mentionable')) {
|
||||||
if (arg.type === ApplicationCommandOptionType.Mentionable) {
|
|
||||||
await message.guild.members.fetch();
|
await message.guild.members.fetch();
|
||||||
payload = message.mentions.members.first() ? message.mentions.members.first() : message.guild.members.cache.find(u => u.user.username.toLowerCase().includes(payload.toLowerCase()));
|
payload = message.mentions.members.first() ? message.mentions.members.first() : message.guild.members.cache.find(u => u.user.username.toLowerCase().includes(payload.toLowerCase()));
|
||||||
}
|
}
|
||||||
|
else if (type.includes('attachment')) {
|
||||||
|
payload = message.attachments.first();
|
||||||
|
}
|
||||||
|
|
||||||
args[payloadName] = payload;
|
args[payloadName] = payload;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue