Updated commands and interactionCreate event

This commit is contained in:
Christer Warén 2021-09-05 03:17:21 +03:00
parent 16bc2aab52
commit 2d41c7a76b
13 changed files with 32 additions and 16 deletions

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'bug',
description: 'Report a bug',
permission: 'none',
category: 'info',
async execute(interaction, client, Discord, command) {
async execute(interaction, client) {
let message = {};
message.bugTitle = client.messages.bugTitle.replace("%client.user.username%", client.user.username);

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'help',
description: 'Get help using bot',
permission: 'none',
category: 'info',
execute(interaction, client, Discord, command) {
execute(interaction, client) {
let message = {};
const categories = [];

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'invite',
description: 'Invite Bot',
permission: 'none',
category: 'info',
execute(interaction, client, Discord, command) {
execute(interaction, client) {
let message = {};
message.inviteTitle = client.messages.inviteTitle.replace("%client.user.username%", client.user.username);
const embed = new Discord.MessageEmbed()

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'list',
description: 'List radio stations',
permission: 'none',
category: 'radio',
execute(interaction, client, Discord) {
execute(interaction, client) {
let message = {};
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'maintenance',
description: 'Bot Maintenance',
permission: 'none',
category: 'info',
execute(interaction, client, Discord, command) {
execute(interaction, client) {
let message = {};
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply(client.messageEmojis["error"] + client.messages.notAllowed);

View File

@ -3,7 +3,7 @@ module.exports = {
description: 'Next Station',
permission: 'none',
category: 'info',
async execute(interaction, client, Discord) {
async execute(interaction, client) {
let message = {};
const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply({

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'nowplaying',
description: 'Current Radio Station',
permission: 'none',
category: 'radio',
async execute(interaction, client, Discord) {
async execute(interaction, client) {
let message = {};
const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply({

View File

@ -13,7 +13,7 @@ module.exports = {
],
permission: "none",
category: "radio",
async execute(interaction, client, Discord, command) {
async execute(interaction, client) {
let message = {};
let query = interaction.options?.getString("query") ?? interaction.values?.[0];
if(!query){

View File

@ -3,7 +3,7 @@ module.exports = {
description: 'Previous Station',
permission: 'none',
category: 'info',
async execute(interaction, client, Discord) {
async execute(interaction, client) {
let message = {};
const radio = client.radio.get(interaction.guild.id);
if (!radio) return interaction.reply({

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'statistics',
description: 'Show statistics',
permission: 'none',
category: 'info',
execute(interaction, client, Discord) {
execute(interaction, client) {
let message = {};
let stations = client.stations;
let currentGuild = client.datastore.getEntry(interaction.guild.id);

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'status',
description: 'Bot Status',
permission: 'none',
category: 'info',
async execute(interaction, client, Discord) {
async execute(interaction, client) {
let message = {};
message.statusTitle = client.messages.statusTitle.replace("%client.user.username%", client.user.username);

View File

@ -1,9 +1,11 @@
import Discord from "discord.js";
module.exports = {
name: 'stop',
description: 'Stop radio',
permission: 'none',
category: 'radio',
async execute(interaction, client, Discord) {
async execute(interaction, client) {
const radio = client.radio.get(interaction.guild.id);
if (client.funcs.check(client, interaction, command)) {
client.funcs.statisticsUpdate(client, interaction.guild, radio);

View File

@ -1,5 +1,3 @@
import Discord from "discord.js";
module.exports = {
name: 'interactionCreate',
async execute(client, interaction) {
@ -13,7 +11,7 @@ module.exports = {
if (!command) return;
try {
command.execute(interaction, client, Discord);
command.execute(interaction, client);
} catch (error) {
interaction.reply({
content: client.messages.runningCommandFailed,
@ -27,7 +25,7 @@ module.exports = {
if (!command) return;
try {
command.execute(interaction, client, Discord);
command.execute(interaction, client);
} catch (error) {
interaction.reply({
content: client.messages.runningCommandFailed,