Files
NitoriBot/src/commands/tps.js
T
2024-05-24 10:07:53 -04:00

67 lines
2.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder } = require('discord.js')
module.exports = {
name: 'tpsbar',
description:['tps'],
trustLevel: 0,
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
usage:["on","off"],
execute (context) {
const bot = context.bot
const source = context.source
const args = context.arguments
if (bot.options.isCreayun || bot.options.useChat) {
throw new CommandError('Cannot execute command because isCreayun or useChat is active!')
} else {
switch (args[0]) {
case 'on':
bot.tps.on()
bot.sendFeedback([{ text: 'TPSBar is now', color: 'dark_gray' },{ text: ' enabled', color: 'green' }])
break
case 'off':
bot.tps.off()
bot.sendFeedback([{ text: 'TPSBar is now ', color: 'dark_gray' },{ text: 'disabled', color: 'red' }])
break
default:
throw new CommandError('Invalid argument')
}
}
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
const source = context.source;
if (bot.options.isCreayun || bot.options.useChat) {
throw new CommandError('Cannot execute command because isCreayun or useChat is active!')
} else {
switch (args[0]) {
case 'on':
bot.tps.on()
// bot.sendFeedback([{ text: 'TPSBar is now', color: 'dark_gray' },{ text: ' enabled', color: 'green' }])
let Embed = new EmbedBuilder()
.setColor(`${bot.Commands.colors.discord.embed}`)
.setTitle(`${this.name} Command`)
.setDescription(`TPSBar is now enabled`)
bot.discord.Message.reply({ embeds: [Embed] })
break
case 'off':
bot.tps.off()
let Embed1 = new EmbedBuilder()
.setColor('#00FFFF')
.setTitle(`${this.name} Command`)
.setDescription(`TPSBar is now disabled`)
bot.discord.Message.reply({ embeds: [Embed1] })
break
default:
throw new CommandError('Invalid argument')
}
}
}
}
//[%s] %s › %s
//was it showing like that before?
// just do text bc too sus rn ig
// You should remove the with thing and the translate and replace
// Parker, why is hashing just random characters???
//wdym