Changed template

This commit is contained in:
2023-04-28 11:48:43 +00:00
parent 37b0fc71ec
commit 0f4cecf9b0
16 changed files with 684 additions and 138 deletions

17
commands/Info/ping.js Normal file
View File

@ -0,0 +1,17 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: "ping",
private: true,
description: "Returns websocket latency",
run: async (client, interaction) => {
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("🏓 Pong!")
.setDescription(`Latency : ${client.ws.ping}ms`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
},
};

View File

@ -0,0 +1,46 @@
const { EmbedBuilder } = require('discord.js');
const wolfcount = require('../../models/wolfcount');
ownerList = [
'213966480621043712',
'237542879227019264',
'294840381080600576'
];
module.exports = {
name: "wolfcountreset",
private: true,
description: "Reset the wolfcount",
run: async (client, interaction) => {
if (ownerList.includes(interaction.user.id)) {
resetcount = 0
// Reset the wolf count
wolfcount.findByIdAndUpdate("6447da87681fd1bc486a4923", {count: resetcount}).then(() => {
console.log('');
console.log('Count reset!');
}).catch((error) => {
console.error(error);
});
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("🐺 count reset")
.setDescription(`The count has been reset. (Requested by: ${interaction.user.tag})`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
} else {
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("🐺 no perms")
.setDescription(`You have no perms to do this.`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
}
},
};

View File

@ -0,0 +1,49 @@
require("dotenv").config();
const { EmbedBuilder } = require('discord.js');
const mongoose = require('mongoose');
const wolfcount = require('../../models/wolfcount');
const uri = `mongodb+srv://${process.env.MONGODBUSER}:${process.env.MONGODBPASS}@${process.env.MONGODBCLUSTER}/${process.env.DATABASE}?retryWrites=true&w=majority`
mongoose.connect(uri, {
useNewUrlParser: true,
useUnifiedTopology: true
}).then(() => {
console.log('');
console.log(`Connected to the database`);
}).catch((error) => {
console.log(`Failed to connect to the database`);
console.log(error);
});
// setInterval(function() {
// // Find a document by validation
// wolfcount.findOne({ validation: 'wolfcount' }).then((countdocument) => {
// console.log('');
// //console.log(countdocument);
// console.log(`Refreshed count`)
// count = countdocument.count
// console.log('');
// }).catch((error) => {
// console.error(error);
// });
// }, 30000);
module.exports = {
name: "wolfcount",
private: false,
description: "Returns the amount of times the letters wolf were said by users (state refreshes every 2 minutes).",
run: async (client, interaction) => {
const embed = new EmbedBuilder()
.setColor("#03FC20")
.setTitle("🐺 count")
.setDescription(`I have counted ${basecount} wolf messages`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
},
};

16
commands/context/ping.js Normal file
View File

@ -0,0 +1,16 @@
const { EmbedBuilder } = require('discord.js');
const {ApplicationCommandType } = require('discord.js');
module.exports = {
name: "ping-test",
type: ApplicationCommandType.Message,
run: async (client, interaction) => {
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("🏓 Pong!")
.setDescription(`Latency : ${client.ws.ping}ms`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
},
};