Skip to content

Commit

Permalink
feat: improve gog embed
Browse files Browse the repository at this point in the history
* setUrl on giveaway
* add game url field
* add unsubscribe url as reminder

Closes: #63
  • Loading branch information
Purexo committed Oct 27, 2023
1 parent b7999d3 commit bcd0678
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/crons/GoG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default new Cron({
name: 'GoG',
description:
'Vérifie toutes les demi heures si GoG offre un jeu (promotion gratuite) et alerte dans #jeux',
schedule: '5,35 * * * *',
// schedule: "* * * * *", // switch for testing
// schedule: '5,35 * * * *',
schedule: '* * * * *', // switch for testing
async handle(context) {
const game = await getOfferedGame(context.logger);

Expand All @@ -38,10 +38,18 @@ export default new Cron({
const channel = findTextChannelByName(context.client.channels, 'jeux');

const embed = new EmbedBuilder()
.setTitle(game.title)
.setURL(game.link)
.setTitle(`GoG - ${game.title}`)
.setURL('https://www.gog.com/#giveaway')
.setDescription(game.description)
.setImage(game.banner)
.addFields({
name: 'URL du jeu',
value: game.link,
})
.addFields({
name: 'Désinscription newsletter',
value: 'https://www.gog.com/fr/account/settings/subscriptions',
})
.addFields({
name: 'Fin',
value: game.discountEndDate.toLocaleDateString('fr-FR', dateFmtOptions),
Expand Down

0 comments on commit bcd0678

Please sign in to comment.