Added Basic Discord Connectivity
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
const { SlashCommandBuilder, Events } = require('discord.js')
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('simjoin')
|
||||
.setDescription('simulates a join event')
|
||||
.addMentionableOption((option) =>
|
||||
option.setName('target').setDescription('user')),
|
||||
async execute(interaction) {
|
||||
|
||||
if(!interaction.member.permissions.has("ADMINISTRATOR")){
|
||||
return await interaction.reply({
|
||||
content: "Unprivileged Access!",
|
||||
ephemeral: true
|
||||
})
|
||||
}
|
||||
|
||||
let target = interaction.options.getMentionable('target')
|
||||
if(!target){
|
||||
target = interaction.member
|
||||
}
|
||||
try {
|
||||
if(target.user.username){
|
||||
interaction.client.emit(Events.GuildMemberAdd, target)
|
||||
await interaction.reply({
|
||||
content: "Done!",
|
||||
ephemeral: true
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
await interaction.reply({
|
||||
content: "Invalid Mentionable!",
|
||||
ephemeral: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
const { SlashCommandBuilder, Events } = require('discord.js')
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('simlive')
|
||||
.setDescription('simulates a live event'),
|
||||
async execute(interaction) {
|
||||
if(!interaction.member.permissions.has("ADMINISTRATOR")){
|
||||
return await interaction.reply({
|
||||
content: "Unprivileged Access!",
|
||||
ephemeral: true
|
||||
})
|
||||
}
|
||||
|
||||
const streamer = 'x__hel__x'
|
||||
interaction.client.emit('TwitchLive', streamer)
|
||||
await interaction.reply({
|
||||
content: "Done!",
|
||||
ephemeral: true
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder, ButtonBuilder } = require('discord.js')
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('socials')
|
||||
.setDescription('links to social media'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply({
|
||||
"components": [
|
||||
{
|
||||
"type": 1,
|
||||
"components": [
|
||||
{
|
||||
"style": 5,
|
||||
"label": `Twitch`,
|
||||
"url": `https://www.twitch.tv/x__hel__x`,
|
||||
"disabled": false,
|
||||
"emoji": {
|
||||
"id": `1136026329091952740`,
|
||||
"name": `Twitch`,
|
||||
"animated": false
|
||||
},
|
||||
"type": 2
|
||||
},
|
||||
{
|
||||
"style": 5,
|
||||
"label": `Twitter`,
|
||||
"url": `https://twitter.com/x__Hel__x`,
|
||||
"disabled": false,
|
||||
"emoji": {
|
||||
"id": `1136026228093095946`,
|
||||
"name": `Twitter`,
|
||||
"animated": false
|
||||
},
|
||||
"type": 2
|
||||
},
|
||||
{
|
||||
"style": 5,
|
||||
"label": `Ko-fi`,
|
||||
"url": `https://ko-fi.com/hel4444/commissions`,
|
||||
"disabled": false,
|
||||
"emoji": {
|
||||
"id": `1136027117428150312`,
|
||||
"name": `Kofi`,
|
||||
"animated": false
|
||||
},
|
||||
"type": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"embeds": [
|
||||
{
|
||||
"type": "rich",
|
||||
"title": `Social Media Links`,
|
||||
"description": `Click on one of these buttons to get to Hel's social media pages.`,
|
||||
"color": 0xdda807,
|
||||
"thumbnail": {
|
||||
"url": `https://cdn.discordapp.com/avatars/901259181397528678/13796c7450e586611042f7c2c72684f7.png?size=4096`,
|
||||
"height": 0,
|
||||
"width": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user