Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bot.on("message", async(message) => {
- const botID = bot.user.id
- const args = message.content.slice(prefix.length).split(/ +/);
- const commandName = args.shift().toLowerCase();
- const command = bot.commands.get(commandName) || bot.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
- const guild = bot.guild
- const errorEm = new Discord.MessageEmbed()
- .setTitle('⛔ Error!')
- .setDescription(`An error oocured whilst trying to exectue the command; **${commandName}**. The error has been logged to the bot console. If this error persists, contact support!`)
- .setColor(0xed4253)
- if (message.content.includes(botID)) {
- message.channel.send('My prefix for this server is `%`!')
- }
- if (message.channel.name === '🔴-report' && !message.author.bot) {
- message.channel.send('<@&805229920925646938> \n Your report will be dealt with shortly. Reminder that no one should communicate within this channel unless they are reporting. Check the pinned messages for further rules and information. Thank you!').then(() => message.react('🔔'));
- }
- if (!message.content.startsWith(prefix) || message.author.bot) return;
- if (!command) return;
- try {
- command.execute(message, args, bot, config);
- } catch (error) {
- console.error(error)
- message.reply(errorEm)
- }
- if(message.channel.parentID !== '756890395392081985') return;
- bot.ticketTranscript.findOne({ Channel : message.channel.id }, async(err, data) => {
- if(err) throw err;
- if(data) {
- console.log('there is data')
- data.Content.push(`${message.author.tag} : ${message.content}`)
- } else {
- console.log('there is no data')
- data = new bot.ticketTranscript({ Channel : message.channel.id, Content: `${message.author.tag} : ${message.content}`})
- }
- await data.save()
- .catch(err => console.log(err))
- console.log('data is saved ')
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment