Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { TOKEN } = require('../Arkansas-Utilities/config.json')
- const { MessageActionRow, ApplicationCommandOptionType, CommandInteraction, MessageButton } = require('discord.js')
- const PREFIX = '-';
- const Discord = require('discord.js');
- const client = new Discord.Client({intents: ['GUILDS', 'GUILD_MEMBERS', 'GUILD_MESSAGES', 'MESSAGE_CONTENT', 'GUILD_MESSAGE_REACTIONS', 'GUILD_VOICE_STATES'] });
- const guild = client.guilds.cache.get("1058088182861791282")
- client.on('messageCreate', async (msg) => {
- console.log(msg.content);
- if (!msg.content.startsWith(PREFIX)) return;
- const args = msg.content.slice(PREFIX.length).split(/ +/)
- const command = args.shift().toLowerCase();
- if (command === 'ping') {
- const apiping = client.ws.ping
- const embed = new Discord.MessageEmbed()
- .setColor('GREEN')
- .setTitle('PONG! :ping_pong:')
- .setDescription(`Bot Latency: **${apiping}ms**`)
- .setTimestamp()
- .setFooter(`Arkansas Utilities`)
- msg.reply({ embeds: [embed] })
- }
- if (command === 'general') {
- const embed = new Discord.MessageEmbed()
- .setColor('GREEN')
- .setTitle(`General Support`)
- .setDescription(`Welcome to your General Support ticket, ${msg.author}!
- Please fill out the format below.
- \ Username:
- Reason:\
- `)
- .setFooter('General Support')
- .setTimestamp()
- // Create a new channel for the ticket
- msg.guild.channels.create(`${msg.author.username}-general`, { type: 'text' })
- .then(channel => {
- // Send a message to the channel
- channel.send(`<@${msg.author.id}>`)
- channel.send({ embeds: [embed] });
- })
- .catch(console.error);
- msg.delete()
- }
- if (command === 'internalaffairs') {
- const embed = new Discord.MessageEmbed()
- .setColor('RED')
- .setTitle(`Internal Affairs Support`)
- .setDescription(`Welcome to your Internal Affairs Support ticket, ${msg.author}!
- Please fill out the format below.
- \ Your Username:
- Staff Username:
- Reason:
- Proof: (Optional)\
- `)
- .setFooter('Internal Affairs Support')
- .setTimestamp()
- // Create a new channel for the ticket
- msg.guild.channels.create(`${msg.author.username}-ia`, { type: 'text' })
- .then(channel => {
- // Send a message to the channel
- channel.send(`<@${msg.author.id}>`)
- channel.send({ embeds: [embed] });
- })
- .catch(console.error);
- msg.delete()
- }
- if (command === 'partnership') {
- const embed = new Discord.MessageEmbed()
- .setColor('YELLOW')
- .setTitle(`Internal Affairs Support`)
- .setDescription(`Welcome to your Partnership Support ticket, ${msg.author}!
- Please fill out the format below.
- \ Server Name:
- Member Count: (Without Bots)
- Bot Count:
- Reason:\
- `)
- .setFooter('Partnership Support')
- .setTimestamp()
- // Create a new channel for the ticket
- msg.guild.channels.create(`${msg.author.username}-partnership`, { type: 'text' })
- .then(channel => {
- // Send a message to the channel
- channel.send(`<@${msg.author.id}>`)
- channel.send({ embeds: [embed] });
- })
- .catch(console.error);
- msg.delete()
- }
- if (command === 'close') {
- if (!msg.member.permissions.has('MANAGE_CHANNELS')) return;
- msg.channel.delete()
- }
- if (command === 'ad') {
- msg.channel.send(
- '```:grandcanyon: __Grand Canyon Roleplay__ :grandcanyon:\n*Welcome to Grand Canyon Roleplay! We are one of the new professional ER:LC servers looking for members. We have it all ;)*\n\n***__What Do we offer?__***\n\n:hammer: -- Professional & Fun Staff\n:clock3: -- Daily SSU\n:man: -- Fun & Realistic Roleplays\n:tada: -- Giveaways\n\n***__Staff Applications__***\n\n:detective: -- Fun & Easy Application\n:clock1: -- Quick And Fast\n:bar_chart: -- 10% Change You Get Denied If You Read Our Rules\n\n**__Apply Now!__**\n\n*Join Us Today At* discord.gg/gK9MEGpxMt```'
- )
- msg.delete()
- }
- if (command === 'emit') {
- const welcomeChannelId = {
- '1058088182861791282': '1058088182861791284'
- }
- const guild = client.guilds.cache.get("1058088182861791282")
- let member = msg.mentions.members.first();
- member.guild.channels.cache.get(welcomeChannelId[member.guild.id]).send(`:wave: Welcome ${member} to **${guild}**! We are now at **${guild.memberCount} members**. Thank you for joining!`)
- const addRole = member.guild.roles.cache.get('1058187823703916604')
- member.roles.add(addRole)
- }
- if (command === 'pingbotowner') {
- msg.channel.send('<@1021959500665737338> is the bot owner!')
- }
- if (command === 'membercount') {
- msg.reply(`There are **${msg.guild.memberCount} members** in this server!`)
- }
- if (command === 'poll') {
- msg.react('✅');
- msg.react('❎');
- }
- if (command === 'warn') {
- if (!msg.member.permissions.has('MANAGE_ROLES')) return;
- let member = msg.mentions.members.first();
- let role = msg.mentions.roles.first();
- if (!member) return msg.reply("⛔️ You have to mention a member!");
- if (!role) return msg.reply("⛔️ You have to mention a warning number!");
- member.roles.add(role);
- msg.channel.send(`✅ ${member} has been warned!`)
- }
- if (command === 'role') {
- if (!msg.member.permissions.has('MANAGE_ROLES')) return;
- let member = msg.mentions.members.first();
- let role = msg.mentions.roles.first();
- if (!member) return msg.reply("⛔️ You have to mention a member!");
- if (!role) return msg.reply("⛔️ You have to mention a role");
- member.roles.add(role);
- msg.channel.send(`✅ ${role} has been given to ${member}!`)
- }
- if (command === 'remrole') {
- if (!msg.member.permissions.has('MANAGE_ROLES')) return;
- let member = msg.mentions.members.first();
- let role = msg.mentions.roles.first();
- if (!member) return msg.reply("⛔️ You have to mention a member!");
- if (!role) return msg.reply("⛔️ You have to mention a role");
- member.roles.remove(role);
- msg.channel.send(`✅ ${role} has been removed from ${member}!`)
- }
- if (command === 'remwarn') {
- if (!msg.member.permissions.has('MANAGE_ROLES')) return;
- let member = msg.mentions.members.first();
- let role = msg.mentions.roles.first();
- if (!member) return msg.reply("⛔️ You have to mention a member!");
- if (!role) return msg.reply("⛔️ You have to mention warning number!");
- member.roles.remove(role);
- msg.channel.send(`✅ ${role} has been removed from ${member}!`)
- }
- if (command === 'beg') {
- msg.reply('Joe came and shot you then he left.')
- }
- if (command === 'say') {
- msg.delete()
- msg.channel.send(args.join(' '));
- }
- if (command === `kick`) {
- if (!args[0]) return msg.reply("⛔️ You need to mention someone to kick!")
- let member = msg.mentions.members.first() || msg.guild.members.cache.get(args[0]) || msg.guild.members.cache.find(x => x.user.username.toLowerCase() === args.slice(0).join(" ") || x.user.username === args[0]);
- if (!msg.member.permissions.has("KICK_MEMBERS")) return msg.reply("⛔️ You do not have permission to kick members!");
- if (!msg.guild.me.permissions.has("KICK_MEMBERS")) return msg.reply("⛔️ I don't have permission to kick members!");
- if (msg.member.id === member.id) return msg.reply("⛔️ You can't kick yourself!");
- member.kick()
- msg.channel.send(`✅ ${member} was successfully kicked!`)
- }
- if (command === `ban`) {
- if (!args[0]) return msg.reply("⛔️ You need to mention someone to ban!")
- let member = msg.mentions.members.first() || msg.guild.members.cache.get(args[0]) || msg.guild.members.cache.find(x => x.user.username.toLowerCase() === args.slice(0).join(" ") || x.user.username === args[0]);
- if (!msg.member.permissions.has("BAN_MEMBERS")) return msg.reply("⛔️ You do not have permission to ban members!");
- if (!msg.guild.me.permissions.has("BAN_MEMBERS")) return msg.reply("⛔️ I do not have permission to ban members!");
- if (msg.member.id === member.id) return msg.reply("⛔️ You can't ban yourself!");
- let reason = args.slice(1).join(" ") || "No reason"
- member.ban({ reason:reason })
- msg.channel.send(`✅ ${member} was successfully banned!\nReason: ${reason}`)
- }
- client.on('ready', () => {
- console.log(`Logged in as ${client.user.tag} and in ${client.guilds.cache.size} servers!`)
- const guild = client.guilds.cache.get("1058088182861791282")
- const servers = client.guilds.cache.size
- const servercount = client.guilds.cache.reduce((a,b) => a+b.memberCount, 0)
- const activities = [
- `Grand Canyon Roleplay`,
- `.gg/JkTzShuNfN -- Watching ${servercount} Users!`
- ]
- setInterval(()=>{
- const status = activities[Math.floor(Math.random()*activities.length)]
- client.user.setPresence({ activities: [{ name: `${status}` }], status: 'dnd'})
- }, 5000)
- const data = [
- {
- name: 'ping',
- description: 'Shows the ping of the bot!'
- },
- {
- name: 'membercount',
- description: 'The amount of members in the server!'
- },
- {
- name: 'beg',
- description: 'Beg someone for money!',
- options: [{
- name: 'who',
- description: 'who do you want to beg',
- type: 'STRING',
- required: true
- }]
- },
- {
- name: 'pingbotmanager',
- description: 'Pings the bot manager!'
- },
- {
- name: "kick",
- description: "Kicks a member from your server",
- options:[{
- name: "user",
- description: "The user to kick",
- type: "USER",
- required: true
- }, {
- name: "reason",
- description: "The reason for the kick",
- type: "STRING"
- }]
- },
- {
- name: "ban",
- description: "Bans a member from your server",
- options:[{
- name: "user",
- description: "The user to ban",
- type: "USER",
- required: true
- }, {
- name: "reason",
- description: "The reason for the ban",
- type: "STRING"
- }]
- },
- {
- name: 'ssu',
- description: 'Start an SSU'
- },
- {
- name: 'ssd',
- description: 'End the SSU'
- },
- {
- name: 'hello',
- description: 'Hello'
- },
- {
- name: 'moneyadd',
- description: 'Give someone money',
- options:[{
- name: "member",
- description: "The user to give money",
- type: "STRING",
- required: true
- }]
- },
- {
- name: 'invite',
- description: 'Invite someone to play with you.',
- options: [{
- name: 'member',
- description: "Ping th member you want to invite",
- type: 'USER',
- required: true
- }, {
- name: 'game',
- description: 'What game do you want to play',
- type: 'STRING',
- required: true
- }]
- },
- {
- name: 'loa',
- description: 'Go on LoA to Leave of Absense',
- options: [{
- name: 'duration',
- description: 'The amount of time you would like to go on LoA',
- type: 'STRING',
- required: true
- }, {
- name: 'reason',
- description: 'The reason you want to go on LoA',
- type: 'STRING',
- required: true
- }]
- }
- ]
- guild.commands?.set(data)
- })
- client.on('interactionCreate', async (inter) => {
- if (inter.isButton()) return;
- if (inter.commandName === 'ping') {
- const apiping = client.ws.ping
- const embed = new Discord.MessageEmbed()
- .setColor('GREEN')
- .setTitle('PONG! :ping_pong:')
- .setDescription(`Bot Latency: **${apiping}ms**`)
- .setTimestamp()
- .setFooter(`Arkansas Utilities`)
- inter.reply({ embeds: [embed] })
- }
- const logChannelId = {
- '1058088182861791282': '1058149796612943892'
- }
- const ssussdChannelId = {
- '1058088182861791282': '1058143101576818759'
- }
- const banrequestChannelId = {
- '1058088182861791282': '1058178225156657182'
- }
- const loaChannelId = {
- '1058088182861791282': '1058177594530472016'
- }
- if (inter.commandName === 'membercount') {
- const embed = new Discord.MessageEmbed()
- .setColor('GREEN')
- .setTitle('Membercount')
- .setDescription(`There are **${inter.guild.memberCount} members** in this server!`)
- .setTimestamp()
- .setFooter(`${inter.guild.memberCount} Members`)
- inter.reply({ embeds: [embed] })
- }
- if (inter.commandName === 'beg') {
- const whobeg = inter.options.getString('who')
- inter.reply(`${whobeg} came and shot you then he left.`)
- }
- if (inter.commandName === 'pingbotmanager') {
- inter.reply(`<@1040838414121050213> is the bot manager!`)
- }
- if (inter.commandName === 'kick') {
- if (!inter.member.permissions.has("KICK_MEMBERS")) return
- const member = inter.options.getMember('user');
- const reason = inter.options.getString('reason') || "No reason given";
- const embed = {
- title: "You have been kicked from " + inter.guild.name,
- description: "Reason: " + reason,
- color: "RED"
- }
- const embed2 = {
- title: "Success",
- description: `Kicked ${member} from ${inter.guild.name}`,
- color: "GREEN"
- }
- const embed3 = {
- title: 'Kick',
- description: `${member} was kicked from ${inter.guild.name}. Reason: ${reason}`,
- color: 'GREEN'
- }
- inter.guild.channels.cache.get(logChannelId[member.guild.id]).send({ embeds: [embed3] })
- member.send({ embeds: [embed] }).catch(() => null)
- inter.reply({ embeds: [embed2] });
- await member.kick(reason).catch(() => null);
- }
- if (inter.commandName === 'ban') {
- if (!inter.member.permissions.has("BAN_MEMBERS")) return
- const member = inter.options.getMember('user');
- const reason = inter.options.getString('reason') || "No reason given";
- const embed = {
- title: "You have been banned from " + inter.guild.name,
- description: "Reason: " + reason,
- color: "RED"
- }
- const embed2 = {
- title: "Success",
- description: `Banned ${member} from ${inter.guild.name}`,
- color: "GREEN"
- }
- const embed3 = {
- title: 'Ban',
- description: `${member} was banned from ${inter.guild.name}. Reason: ${reason}`,
- color: 'GREEN'
- }
- inter.guild.channels.cache.get(logChannelId[member.guild.id]).send({ embeds: [embed3] })
- member.send({ embeds: [embed] }).catch(() => null)
- inter.reply({ embeds: [embed2] });
- await member.ban({ reason: reason }).catch(() => null)
- }
- if (inter.commandName === 'ssu') {
- const ssuembed = {
- title: 'SSU',
- description: `The server is now active.
- You can join now. If you have any issues or questions, feel free to open a ticket in <#1058141449788608632>
- Server Name: Grand Canyon Roleplay | Strict | Professional
- Server Code: ***Coming Soon***
- Server Owner: AlphaMinedime#8578
- Game link: https://www.roblox.com/games/2534724415/Emergency-Response-Liberty-County`,
- color: 'GREEN'
- }
- inter.guild.channels.cache.get(ssussdChannelId[inter.guild.id]).send(`@here / <@&1058380440894984272>`)
- inter.guild.channels.cache.get(ssussdChannelId[inter.guild.id]).send({ embeds: [ssuembed] })
- inter.reply({content: `SSU started!`, ephemeral: true })
- }
- if (inter.commandName === 'ssd') {
- const ssdembed = {
- title: 'SSD',
- description: `The server has now Shut Down! Thanks for joining us!
- Do not re-join until the next SSU. If you have any issues or questions, feel free to open a ticket in <#1058141449788608632>`,
- color: 'RED'
- }
- inter.guild.channels.cache.get(ssussdChannelId[inter.guild.id]).send({ embeds: [ssdembed] })
- inter.reply({content: `Successfully ended the SSU`, ephemeral: true })
- }
- if (inter.commandName === 'hello') {
- inter.reply(`Hi`)
- }
- if (inter.commandName === 'moneyadd') {
- const money = inter.options.getString('member')
- inter.reply(`Couldn't give money to ${money} because I am broke myself! XD`)
- }
- if (inter.commandName === 'invite') {
- const member = inter.options.get('member')
- const game = inter.options.getString('game')
- inter.reply(`Hey ${member.user} , ${inter.user} is inviting you to play **${game}** with them!`)
- }
- if (inter.commandName === 'loa') {
- const duration = inter.options.getString('duration')
- const reason = inter.options.getString(`reason`)
- const embed = new Discord.MessageEmbed()
- .setColor(`ORANGE`)
- .setTitle(`LoA Request`)
- .setDescription(`User: ${inter.user}
- Duration: **${duration}**
- Reason: **${reason}**`)
- .setFooter(`${inter.user.tag}`)
- .setTimestamp()
- inter.guild.channels.cache.get(loaChannelId[inter.guild.id]).send({ embeds: [embed] })
- inter.reply({ content: `Successfully requested an LoA for **${duration}** with the reason of **${reason}**`, ephemeral: true })
- }
- })
- client.on('guildMemberAdd', (member) => {
- const welcomeChannelId = {
- '1058088182861791282': '1058088182861791284'
- }
- try {
- const guild = client.guilds.cache.get("1058088182861791282")
- member.guild.channels.cache.get(welcomeChannelId[member.guild.id]).send(`:wave: Welcome ${member} to **${guild}**! We are now at **${guild.memberCount} members**. Thank you for joining!`)
- const MemberRoleAdd = member.guild.roles.cache.get('1058187823703916604')
- member.roles.add(MemberRoleAdd)
- } catch (error) {
- console.error(error)
- }
- })
- })
- client.login(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment