diff --git a/config.example.ts b/config.example.ts index bd5086c..bca27aa 100644 --- a/config.example.ts +++ b/config.example.ts @@ -16,6 +16,7 @@ export const config = { 'sourceCode': 'https://github.com/Burn-E99/GroupUp', // Link to the repository 'supportServer': '', // Invite link to the Discord support server 'addToCalendar': '', // Link to where the icsGenerator is hosted + 'creatorIcon': '', // Link to where the GroupUpSinglePerson.png (or similar image) is hosted }, 'logChannel': 'the_log_channel', // Discord channel ID where the bot should put startup messages and other error messages needed 'reportChannel': 'the_report_channel', // Discord channel ID where reports will be sent when using the built-in report command diff --git a/src/buttons/event-creation/step2-finalize.ts b/src/buttons/event-creation/step2-finalize.ts index 15eea90..b5063ef 100644 --- a/src/buttons/event-creation/step2-finalize.ts +++ b/src/buttons/event-creation/step2-finalize.ts @@ -8,12 +8,12 @@ import { getDateFromRawInput } from './dateTimeUtils.ts'; export const customId = 'finalize'; const execute = async (bot: Bot, interaction: Interaction) => { - if (interaction?.data?.components?.length && interaction.guildId && interaction.channelId && interaction.member) { + if (interaction?.data?.components?.length && interaction.guildId && interaction.channelId && interaction.member && interaction.member.user) { const tempDataMap: Map = new Map(); for (const row of interaction.data.components) { if (row.components?.[0]) { const textField = row.components[0]; - tempDataMap.set(textField.customId || 'missingCustomId', textField.value || 'missingValue'); + tempDataMap.set(textField.customId || 'missingCustomId', textField.value || ''); } } @@ -43,7 +43,7 @@ const execute = async (bot: Bot, interaction: Interaction) => { const rawEventTime = tempDataMap.get(eventTimeId) || ''; const rawEventTimeZone = tempDataMap.get(eventTimeZoneId) || ''; const rawEventDate = tempDataMap.get(eventDateId) || ''; - const eventDescription = tempDataMap.get(eventDescriptionId) || 'No Description Provided.'; + const eventDescription = tempDataMap.get(eventDescriptionId) || 'No description provided.'; if (!rawEventTime || !rawEventTimeZone || !rawEventDate) { // Error out if user somehow failed to provide one of the fields (eventDescription is allowed to be null/empty) somethingWentWrong(bot, interaction, `missingFieldFromEventDescription@${rawEventTime}_${rawEventTimeZone}_${rawEventDate}`); @@ -56,7 +56,7 @@ const execute = async (bot: Bot, interaction: Interaction) => { bot.helpers.sendInteractionResponse( interaction.id, interaction.token, - createLFGPost(category, activity, eventDateTime, eventDateTimeStr, eventDescription, interaction.member.nick || 'test', [], [], customIdIdxPath, true), + createLFGPost(category, activity, eventDateTime, eventDateTimeStr, eventDescription, interaction.member.id, interaction.member.user.username, [], [], customIdIdxPath, true), ); // somethingWentWrong(bot, interaction, `TESTING@${rawEventTime}_${rawEventTimeZone}_${rawEventDate}`); diff --git a/src/buttons/event-creation/utils.ts b/src/buttons/event-creation/utils.ts index 6cbae16..0735fc4 100644 --- a/src/buttons/event-creation/utils.ts +++ b/src/buttons/event-creation/utils.ts @@ -150,6 +150,7 @@ export const createLFGPost = ( eventDateTime: Date, eventDateTimeStr: String, eventDescription: string, + authorId: bigint, author: string, memberList: Array, alternateList: Array, @@ -191,6 +192,7 @@ export const createLFGPost = ( }], footer: { text: `Created by: ${author}`, + iconUrl: `${config.links.creatorIcon}#${authorId}`, }, timestamp: eventDateTime.getTime(), }], diff --git a/www/GroupUpSinglePerson.png b/www/GroupUpSinglePerson.png new file mode 100644 index 0000000..d137514 Binary files /dev/null and b/www/GroupUpSinglePerson.png differ