Skip to content

Commit

Permalink
Merge formatting
Browse files Browse the repository at this point in the history
Merge formatting into main
  • Loading branch information
github-actions[bot] authored Aug 10, 2023
2 parents a22bd55 + 0e8e38e commit 977a39f
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 32 deletions.
22 changes: 16 additions & 6 deletions src/buttons/neverhaveiever.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, PermissionFlagsBits } = require("discord.js");
const {
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
PermissionFlagsBits,
} = require("discord.js");

module.exports = {
data: {
name: "neverhaveiever",
description: "never have i ever",
},
async execute(interaction, client, guildDb) {
if (!interaction.channel.permissionsFor(interaction.user.id).has(PermissionFlagsBits.SendMessages))
return interaction.reply({
content: "You don't have permission to use this button in this channel!",
ephemeral: true,
});
if (
!interaction.channel
.permissionsFor(interaction.user.id)
.has(PermissionFlagsBits.SendMessages)
)
return interaction.reply({
content:
"You don't have permission to use this button in this channel!",
ephemeral: true,
});
const { Funny, Basic, Young, Food, RuleBreak } =
await require(`../data/nhie-${guildDb.language}.json`);
const neverArray = [...Funny, ...Basic, ...Young, ...Food, ...RuleBreak];
Expand Down
25 changes: 17 additions & 8 deletions src/buttons/wouldyourather.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, PermissionFlagsBits } = require("discord.js");
const {
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
PermissionFlagsBits,
} = require("discord.js");

module.exports = {
data: {
name: "wouldyourather",
description: "would you rather",
},
async execute(interaction, client, guildDb) {

if (!interaction.channel.permissionsFor(interaction.user.id).has(PermissionFlagsBits.SendMessages))
return interaction.reply({
content: "You don't have permission to use this button in this channel!",
ephemeral: true,
});

if (
!interaction.channel
.permissionsFor(interaction.user.id)
.has(PermissionFlagsBits.SendMessages)
)
return interaction.reply({
content:
"You don't have permission to use this button in this channel!",
ephemeral: true,
});

const { General } =
await require(`../data/rather-${guildDb.language}.json`);
if (!guildDb.replay)
Expand Down
22 changes: 16 additions & 6 deletions src/buttons/wwyd.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, PermissionFlagsBits } = require("discord.js");
const {
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
PermissionFlagsBits,
} = require("discord.js");

module.exports = {
data: {
name: "wwyd",
description: "What would you do",
},
async execute(interaction, client, guildDb) {
if (!interaction.channel.permissionsFor(interaction.user.id).has(PermissionFlagsBits.SendMessages))
return interaction.reply({
content: "You don't have permission to use this button in this channel!",
ephemeral: true,
});
if (
!interaction.channel
.permissionsFor(interaction.user.id)
.has(PermissionFlagsBits.SendMessages)
)
return interaction.reply({
content:
"You don't have permission to use this button in this channel!",
ephemeral: true,
});
const { WhatYouDo } = require(`../data/wwyd-${guildDb.language}.json`);
const randomNever = Math.floor(Math.random() * WhatYouDo.length);
const wwydstring = WhatYouDo[randomNever];
Expand Down
22 changes: 11 additions & 11 deletions src/commands/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ module.exports = {
de: "Ändere die Sprache für den aktuellen Server",
"es-ES": "Cambiar el idioma del bot en el servidor",
})
.addStringOption(option =>
option.setName('language')
.setDescription('The language you want to use.')
.addStringOption((option) =>
option
.setName("language")
.setDescription("The language you want to use.")
.setRequired(true)
.addChoices(
{ name: 'Deutsch', value: 'german' },
{ name: 'English', value: 'english' },
{ name: 'Español', value: 'spanish' },
)),
.addChoices(
{ name: "Deutsch", value: "german" },
{ name: "English", value: "english" },
{ name: "Español", value: "spanish" },
),
),

/**
* @param {CommandInteraction} interaction
Expand All @@ -32,9 +34,7 @@ module.exports = {
*/
async execute(interaction, client, guildDb) {
let languageembed;
if (
interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)
) {
if (interaction.member.permissions.has(PermissionFlagsBits.ManageGuild)) {
switch (interaction.options.getString("language")) {
case "english": {
await client.database.updateGuild(
Expand Down
3 changes: 2 additions & 1 deletion src/events/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ module.exports = async (client, interaction) => {
return interaction
.reply({
ephemeral: true,
content: `You can use this button again <t:${Math.floor(client.used.get(interaction.user.id) / 1000,
content: `You can use this button again <t:${Math.floor(
client.used.get(interaction.user.id) / 1000,
)}:R>!`,
})
.catch(() => {});
Expand Down

0 comments on commit 977a39f

Please # to comment.