continue work on retrofit
This commit is contained in:
parent
8e912ca8f2
commit
3b1e6b6370
|
@ -254,6 +254,8 @@ The Discord Slash Command system will ensure you provide all the required detail
|
||||||
if (oldEvent && oldEvent.embeds[0].fields && oldEvent.embeds[0].footer) {
|
if (oldEvent && oldEvent.embeds[0].fields && oldEvent.embeds[0].footer) {
|
||||||
const eventMembers = [...getLfgMembers(oldEvent.embeds[0].fields[LfgEmbedIndexes.JoinedMembers].value), ...getLfgMembers(oldEvent.embeds[0].fields[LfgEmbedIndexes.AlternateMembers].value)]
|
const eventMembers = [...getLfgMembers(oldEvent.embeds[0].fields[LfgEmbedIndexes.JoinedMembers].value), ...getLfgMembers(oldEvent.embeds[0].fields[LfgEmbedIndexes.AlternateMembers].value)]
|
||||||
const eventDateTime = new Date((oldEvent.embeds[0].fields[LfgEmbedIndexes.StartTime].value.split('tz#')[1] || ' ').slice(0, -1));
|
const eventDateTime = new Date((oldEvent.embeds[0].fields[LfgEmbedIndexes.StartTime].value.split('tz#')[1] || ' ').slice(0, -1));
|
||||||
|
console.log(oldEvent.embeds[0].fields[LfgEmbedIndexes.StartTime].value)
|
||||||
|
if (!isNaN(eventDateTime.getTime())) {
|
||||||
const eventDateTimeStr = (oldEvent.embeds[0].fields[LfgEmbedIndexes.StartTime].value.split('](')[0] || ' ').slice(1);
|
const eventDateTimeStr = (oldEvent.embeds[0].fields[LfgEmbedIndexes.StartTime].value.split('](')[0] || ' ').slice(1);
|
||||||
oldEvent.embeds[0].fields[LfgEmbedIndexes.StartTime].value = generateTimeFieldStr(eventDateTimeStr, eventDateTime);
|
oldEvent.embeds[0].fields[LfgEmbedIndexes.StartTime].value = generateTimeFieldStr(eventDateTimeStr, eventDateTime);
|
||||||
oldEvent.embeds[0].footer.text = oldEvent.embeds[0].footer.text.split(' | ')[0];
|
oldEvent.embeds[0].footer.text = oldEvent.embeds[0].footer.text.split(' | ')[0];
|
||||||
|
@ -267,7 +269,9 @@ The Discord Slash Command system will ensure you provide all the required detail
|
||||||
type: MessageComponentTypes.ActionRow,
|
type: MessageComponentTypes.ActionRow,
|
||||||
components: generateLFGButtons(false),
|
components: generateLFGButtons(false),
|
||||||
}],
|
}],
|
||||||
})
|
}).catch((e: Error) => utils.commonLoggers.messageEditError('setup.ts', 'retrofit event', e));
|
||||||
|
dbClient.execute(queries.insertEvent, [oldEvent.id, oldEvent.channelId, interaction.guildId, ownerId, eventDateTime]).catch((e) => utils.commonLoggers.dbError('setup.ts@retrofit', 'INSERT event to DB', e));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue