Added Basic Discord Connectivity

This commit is contained in:
DeSqBlocki
2025-02-08 16:47:07 +01:00
parent 8292db72e3
commit bd782b0567
14 changed files with 511 additions and 333 deletions
+42
View File
@@ -0,0 +1,42 @@
const { SlashCommandBuilder } = require('discord.js')
const { mClient } = require('../..')
module.exports = {
data: new SlashCommandBuilder()
.setName('simshoutout')
.setDescription('simulates a shoutout event'),
async execute(interaction) {
await interaction.deferReply()
if (!interaction.member.permissions.has("ADMINISTRATOR")) {
return await interaction.editReply({
content: "Unprivileged Access!",
ephemeral: true
})
}
let channel = '#desq_blocki'
let username = 'desq_blocki'
let db = mClient.db("shoutouts")
let col = db.collection(channel)
let query = { user: username }
let status = await col.findOne(query)
if (!status) {
interaction.client.emit("TwitchShoutout", "TEST", channel, username)
await col.insertOne({
user: username
})
await interaction.editReply({
content: "Done!",
ephemeral: true
})
} else {
await interaction.editReply({
content: "Already in Database",
ephemeral: true
})
}
}
}