Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ ADMINISTRATOR_TAG_ID=1014267063788908585
ADMIN_POINT_REQUEST_CHANNEL=1310614733803618416
PR_TEMPLATE_ALLOWED_CHANNELS="1270770663048613983,general;1309628262456098878,qa-request;"

# Assign task Forum
AVAILABLE_TAG_ID='1351647448019370105' # ID for available tag for tasks
ASSIGNED_TAG_ID='1351647194251268318' # ID for assigned tag for tasks

# Scheduled messages
TIME_ZONE='America/Bogota'
SCHEDULED_CALENDAR_INTERVAL='*/20 8-17 * * 1-5'
Expand Down
Binary file removed docs/configuration/discord_webhook/integrations.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed docs/configuration/github_pat/classic_token.png
Binary file not shown.
Binary file removed docs/configuration/github_pat/developer_settings.png
Binary file not shown.
Binary file removed docs/configuration/github_pat/pat_classic_form.png
Binary file not shown.
Binary file removed docs/configuration/github_pat/profile_settings.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed docs/configuration/github_webhook/payload_url.png
Binary file not shown.
Binary file not shown.
Binary file removed docs/configuration/github_webhook/webhook_tab.png
Binary file not shown.
113 changes: 0 additions & 113 deletions docs/github-webhook.md

This file was deleted.

2 changes: 0 additions & 2 deletions src/commands/commandList.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const serverCommand = require('./utility/server');
const userCommand = require('./utility/user');
const votePointsCommand = require('./utility/vote-points');
const assingPointCommand = require('./utility/assignPoint');
const assignTaskForum = require('./utility/assignTaskForum');

const commandList = [
pingCommand,
Expand All @@ -31,6 +30,5 @@ const commandList = [
userCommand,
votePointsCommand,
assingPointCommand,
assignTaskForum,
];
module.exports = commandList;
95 changes: 0 additions & 95 deletions src/commands/utility/assignTaskForum.js

This file was deleted.

35 changes: 3 additions & 32 deletions src/commands/utility/changeStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const createStatusMenu = (channel) => {
Object.keys(MAPPED_STATUS_COMMANDS[selectedChannel]).map((status) => {
return new StringSelectMenuOptionBuilder()
.setLabel(status)
.setDescription(status)
.setValue(status);
})
);
Expand All @@ -27,48 +28,18 @@ module.exports = {
data: new SlashCommandBuilder()
.setName('change-status')
.setDescription(translateLanguage('changeStatus.description'))
.setDescriptionLocalizations(keyTranslations('changeStatus.description'))
.addStringOption((option) =>
option
.setName('message')
.setDescription(translateLanguage('changeStatus.messageOption'))
.setDescriptionLocalizations(
keyTranslations('changeStatus.messageOption')
)
.setRequired(false)
),
.setDescriptionLocalizations(keyTranslations('changeStatus.description')),
async execute(interaction) {
try {
const { channel, user } = interaction;
const { channel } = interaction;
const selectMenu = createStatusMenu(channel.name);
const message = interaction.options.getString('message');

if (!interaction.channel.isThread()) {
return await interaction.editReply({
content: translateLanguage('changeStatus.notAThread'),
ephemeral: true,
});
}

const row = new ActionRowBuilder().addComponents(selectMenu);

await interaction.reply({
content: translateLanguage('changeStatus.selectStatus'),
components: [row],
});

if (message) {
const markdownMessage =
`# ${translateLanguage('changeStatus.markdownMessage')}\n\n` +
`${message}\n\n` +
`> ${user}`;

await channel.send(markdownMessage);
}

await interaction.followUp({
content: translateLanguage('changeStatus.statusUpdatedSuccesfully'),
});
} catch (error) {
console.error(error);
await sendErrorToChannel(interaction, error);
Expand Down
8 changes: 0 additions & 8 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('dotenv').config();
const { parseAllowedChannels } = require('./csv-parser-allowed-channels');
const path = require('path');

Check warning on line 3 in src/config.js

View workflow job for this annotation

GitHub Actions / Run ESLint and Prettier

Do not import Node.js builtin module "path"

const DISCORD_SERVER = {
discordToken: process.env.DISCORD_TOKEN,
Expand Down Expand Up @@ -179,13 +179,6 @@
githubPRPublishEnabled: process.env.GITHUB_PR_PUBLISH_ENABLED === 'true',
};

const ASSIGN_TASK_FORUM = {
tags: {
availableTagId: process.env.AVAILABLE_TAG_ID,
assignedTagId: process.env.ASSIGNED_TAG_ID,
},
};

module.exports = {
LISTEN_NEW_EVENTS,
DISCORD_SERVER,
Expand All @@ -202,5 +195,4 @@
FIREBASE_CONFIG,
ADMIN_ROLE_ID,
GITHUB_PUBLISH_OPENED_PR,
ASSIGN_TASK_FORUM,
};
2 changes: 1 addition & 1 deletion src/cron/schedule-google-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const scheduleEventNotification = async ({ client, event }) => {
const job = new CronJob(
cronExpression,
async () => {
await sendCalendarEventNotification();
await sendCalendarEventNotification(client, event);
},
null,
true,
Expand Down
15 changes: 2 additions & 13 deletions src/languages/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
"error": "An error occurred while updating the status.",
"messageOption": "Send a message to detail your changes",
"statusChanged": "Status changed to {{status}}",
"selectStatus": "Choose your status",
"placeholder": "Make a selection",
"markdownMessage": "Channel status changed",
"statusUpdatedSuccesfully": "Status updated successfully!"
"chooseYourStatus": "Choose your status",
"placeholder": "Make a selection"
},
"convertTime": {
"description": "Convert time between time zones",
Expand Down Expand Up @@ -227,14 +225,5 @@
"pullRequestOpen": {
"errorExtractDataFromURL": "Error extracting repository or PR number from URL.",
"errorFetchPR": "Error trying to fetch PR data to {{prURL}}. URL: {{prURL}}. status: {{status}}"
},
"assignTaskForum": {
"description": "Assign the user tag to a task posted on the forum.",
"userOption": "User to assign",
"isNotForumThread": "This thread is not from a forum for assigning tasks.",
"userTagNotAvailable": "This user is not available in tags.",
"userAssignedTask": "This user is already assigned in this task",
"taskAssignedSuccessful": "This task was assigned successfully!",
"error": "An error occurred while assigning the task."
}
}
15 changes: 2 additions & 13 deletions src/languages/translations/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
"error": "Ocurrió un error al actualizar el estado.",
"messageOption": "Envia un mensage para detallar tus cambios",
"statusChanged": "Estado cambiado a {{status}}",
"selectStatus": "Elige tu estado",
"placeholder": "Haz una selección",
"markdownMessage": "Estado del canal cambiado",
"statusUpdatedSuccesfully": "Estado actualizado exitosamente!"
"chooseYourStatus": "Elige tu estado",
"placeholder": "Haz una selección"
},
"convertTime": {
"description": "Convertir hora entre zonas horarias",
Expand Down Expand Up @@ -228,14 +226,5 @@
"pullRequestOpen": {
"errorExtractDataFromURL": "Error al extraer el nombre del repositorio o el número de PR de la URL.",
"errorFetchPR": "Error al intentar obtener datos del PR. URL: {{prURL}}. Estado: {{status}}"
},
"assignTaskForum": {
"description": "Asigna la etiqueta de usuario a una tarea publicada en el foro.",
"userOption": "Usuario para asignar",
"isNotForumThread": "Este hilo no es de un foro para asignar tareas.",
"userTagNotAvailable": "Este usuario no está disponible en las etiquetas.",
"userAssignedTask": "Este usuario ya está asignado en esta tarea",
"taskAssignedSuccessful": "¡Esta tarea se asignó exitosamente!",
"error": "Ocurrió un error al asignar la tarea."
}
}
Loading
Loading