Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubaid7 authored Jun 29, 2021
1 parent 41c9d21 commit d09488f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Episode 50/commands/Per-Server-Commands/Set/setchatbot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const db = require('quick.db')

module.exports = {
commands: ['setchatbot', 'set-chat-bot'], // You Can Keep Any Name
description: 'Set Chat Bot Channel', // Optional
permissions: 'MANAGE_CHANNELS', // // You Can Keep Any Permission
permissionError: 'You Dont Have Permission To Use This Command', // Optional

callback: async(message, args, client) => {
const channel = args[0]
if(!channel) return message.reply('Which Channel you You Want To Set As Chat Bot?') // If No Channel is Provided
if(isNaN(parseInt(args[0]))) return message.reply('Channel ID Isn\'t A Number') // If Channel ID Is Provided As Name
const chatbotchannel = db.fetch(`chatbotchannel_${message.guild.id}`) // Get ChatBoChannel
if(chatbotchannel !== null) return message.reply(`Chat Bot Channel Is Already Set. Current Channel Is <#${chatbotchannel}>. Reset Channel To Set Again`) // If Channel is Already Set
else if(chatbotchannel === null) { // If Channel is Not Set Then...
message.reply(`Chat Bot Channel Set To <#${channel}>`)
db.set(`chatbotchannel_${message.guild.id}`, channel) // Set Chat Bot Channel
}

}
}
20 changes: 19 additions & 1 deletion Episode 50/commands/Per-Server-Commands/Set/setprefix.js
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@

const db = require('quick.db')

module.exports = {
commands: ['set-prefix'], // You Can Keep Any Name
description: 'Set Prefix For Server', // Optional
permissions: 'MANAGE_GUILD', // You Can Keep Any Permission
permissionError: 'You Dont Have Permission To Use This Command', // Optional

callback: async(message, args, client) => {

const newprefix = args[0] // New Prefix
if(!newprefix) return message.reply('What Prefix Do You Want To Keep As?') // If No Prefix Is Added
else if(newprefix.length > 4) return message.reply('Your Prefix Is Too Long, Chose Shorter(Less Then 4 Character)') // If Prefix Is More Then 4 Character's
else {
message.reply(`Prefix Set As **${newprefix}**`)
db.set(`prefix_${message.guild.id}`, newprefix) // Set New Prefix
}
}
}

0 comments on commit d09488f

Please sign in to comment.