Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .env.coolify.example
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ LARGERIO_API_KEY=
HEROKU_URL=
HEROKU_OAUTH_ID=
HEROKU_OAUTH_SECRET=
DONATION_AMOUNT=
SUBSCRIPTION_AMOUNT=
4 changes: 2 additions & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ test/html/clima-* @juanbrujo
test/clima.test.js @juanbrujo
scripts/coinmarketcap.js @hectorpalmatellez
test/coinmarketcap.test.js @hectorpalmatellez
scripts/como-donar.js @juanbrujo
test/como.test-donar.js @juanbrujo
Comment thread
hectorpalmatellez marked this conversation as resolved.
scripts/como-apoyar.js @juanbrujo
scripts/como-apoyar.test.js @juanbrujo
scripts/concurso.js @juanbrujo
test/concurso.test.js @juanbrujo
scripts/correos.js @hectorpalmatellez
Expand Down
63 changes: 63 additions & 0 deletions scripts/como-apoyar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Description:
// Huemul explica con peras y manzanas cómo apoyar a la comunidad
//
// Dependencies:
// None
//
// Configuration:
// None
//
// Commands:
// hubot como apoyar - Muestra las instrucciones de cómo apoyar
// hubot cómo apoyar - Muestra las instrucciones de cómo apoyar
//
// Authors:
// @jorgeepunan @hectorpalmatellez

const SUPPORT_AMOUNT = process.env.SUBSCRIPTION_AMOUNT || 'US$5'
const PAYMENT_METHODS = new Map([
[
'Suscripción',
'Usamos Reveniu para recibir <https://app.reveniu.com/checkout-custom-link/9VamNpRD9b0LNZ3N4NAl2MG5TyY98zln| suscripciones con tarjetas de crédito y débito>. Puedes elegir entre un <https://app.reveniu.com/checkout-custom-link/X6wYvaeZJ4RDFJFKEF93bTBEUOXhTUVV|pago único> o una <https://app.reveniu.com/checkout-custom-link/9VamNpRD9b0LNZ3N4NAl2MG5TyY98zln|suscripción mensual>.'
],
[
'Transferencia',
`Puedes transferir en pesos chilenos lo equivalente a ${SUPPORT_AMOUNT} a través de la cuenta de :devschile:, escríbele a un admin para que te dé la info bancaria.`
]
])

module.exports = robot => {
robot.respond(/c(o|ó)mo apoyar/i, msg => {
const text =
`Para mantener el servidor donde se aloja el :robot_face: :huemul: y otros proyectos que creamos desde y para la comunidad, se reciben aportes desde ${SUPPORT_AMOUNT} por diferentes medios`
const footer =
'Gracias :pray: por el interés y por las ganas de aportar :gold: a que siga creciendo la comunidad devsChile. Hacemos buen uso de los aportes, desde el pago de los servidores hasta concursos y sorteos de cursos en Udemy, entre otros. :heartbeat:'
const fields = []
let payments = ''
PAYMENT_METHODS.forEach((value, title) => {
fields.push({ title, value, short: false })
payments += `· *${title}*: ${value}\n`
})
const fallback = `${text}:\n${payments}${footer}`
if (['SlackBot', 'Room'].includes(robot.adapter.constructor.name)) {
const options = {
as_user: true,
link_names: 1,
unfurl_links: false,
attachments: [
{
fallback,
text,
title: 'Cómo apoyar',
title_link: 'https://devschile.cl/',
fields,
footer
}
]
}
robot.adapter.client.web.chat.postMessage(msg.message.room, null, options)
} else {
msg.send(fallback)
}
})
}
63 changes: 0 additions & 63 deletions scripts/como-donar.js

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/gold.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Description:
// Obtener gold con una key válida ó una donación
// Obtener gold con una key válida ó una suscripción
//
// Dependencies:
// None
Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = robot => {
if (key === null) {
const channel = res.channels.find(channel => channel.name === process.env.GOLD_CHANNEL || channel.name === 'random')
channelId = channel.id
message = `:clap2: *${name}* donó a :huemul:, se lleva swag :devschile: y es miembro gold :monea: por ${humanizedDuration}!`
message = `:clap2: *${name}* se suscribió a :huemul:, se lleva un regalito :devschile: y es miembro gold :monea: por ${humanizedDuration}!`
} else {
goldUsers[name].key = key
}
Expand Down Expand Up @@ -194,7 +194,7 @@ module.exports = robot => {
} else {
const admins = process.env.HUBOT_AUTH_ADMIN
if (admins) {
let message = `El email ${req.body.email} acaba de donar pero no `
let message = `El email ${req.body.email} acaba de suscribirse pero no `
message += 'logré determinar qué usuario es para agregarlo a los '
message += 'gold :monea:.\nEste mensaje fue enviado a todos los '
message += 'administradores DevsChile.'
Expand Down
14 changes: 7 additions & 7 deletions scripts/wallets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Description:
// Display :huemul: addresses to receive crypto currencies as donation
// Display :huemul: addresses to receive crypto as subscriptions
//
// Dependencies:
// none
Expand All @@ -9,10 +9,10 @@
// WALLET_ETH
//
// Commands:
// hubot wallet btc - Display :huemul: addresses to receive bitcoin as donation
// hubot wallet bitcoin - Display :huemul: addresses to receive bitcoin as donation
// hubot wallet eth - Display :huemul: addresses to receive ethereum as donation
// hubot wallet ethereum - Display :huemul: addresses to receive ethereum as donation
// hubot wallet btc - Display :huemul: addresses to receive bitcoin as subscription fee
// hubot wallet bitcoin - Display :huemul: addresses to receive bitcoin as subscription fee
// hubot wallet eth - Display :huemul: addresses to receive ethereum as subscription fee
// hubot wallet ethereum - Display :huemul: addresses to receive ethereum as subscription fee
// hubot wallet help - Display help
//
// Author:
Expand All @@ -33,9 +33,9 @@ module.exports = function (robot) {
const currency = msg.match[1].toLowerCase()

if (currency === 'btc' || currency === 'bitcoin') {
msg.send(`Mi wallet de Bitcoin para donaciones es \`${WALLET_BTC}\``)
msg.send(`Mi wallet de Bitcoin para suscripciones es \`${WALLET_BTC}\``)
} else if (currency === 'eth' || currency === 'ethereum') {
msg.send(`Mi wallet de Ethereum para donaciones es \`${WALLET_ETH}\``)
msg.send(`Mi wallet de Ethereum para suscripciones es \`${WALLET_ETH}\``)
} else if (currency === 'help') {
msg.send('Por ahora solo tengo 👜 de ETH y BTC, se utiliza así: `huemul wallet btc`')
}
Expand Down
Loading