Sanitize usernames for display (#4)
* Sanitize away underscores and asterisks for display names * Bump version * Bump version and date * Formatting and rename param * Un-raw dogged formatting * lmao I don't know TS * V1.1.6 - properly fix the formatting issue --------- Co-authored-by: Ean Milligan <ean.milligan@gmail.com>
This commit is contained in:
parent
b2c821991d
commit
c7d12c25f4
|
@ -1,4 +1,4 @@
|
|||
# Group Up - An Event Scheduling Discord Bot | V1.1.5 - 2024/06/28
|
||||
# Group Up - An Event Scheduling Discord Bot | V1.1.6 - 2024/07/06
|
||||
[](https://sonarcloud.io/summary/new_code?id=GroupUp)
|
||||
[](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp) [](https://sonarcloud.io/summary/new_code?id=GroupUp)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export const config = { // !! NOTICE !! All fields below are required unless they are explicitly noted as OPTIONAL. If a field is OPTIONAL, do not remove it from this file, just leave it at the default value
|
||||
'name': 'Group Up', // Name of the bot
|
||||
'version': '1.1.5', // Version of the bot
|
||||
'version': '1.1.6', // Version of the bot
|
||||
'token': 'the_bot_token', // Discord API Token for this bot
|
||||
'localToken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS SHOULD BE DIFFERENT FROM "token"
|
||||
'prefix': '/', // Prefix for all commands, as this bot uses slash commands, this needs to be '/'
|
||||
|
|
|
@ -27,10 +27,12 @@ export const alternateEventBtnStr = 'Join as Alternate';
|
|||
export const noDescProvided = 'No description provided.';
|
||||
|
||||
// Member List generators
|
||||
const escapeMemberNameForDisplay = (memberName: string): string => memberName.replaceAll('\\', '').replaceAll('_', '\\_');
|
||||
export const generateMemberTitle = (memberList: Array<LFGMember>, maxMembers: number): string => `Members Joined: ${memberList.length}/${maxMembers}`;
|
||||
export const generateMemberList = (memberList: Array<LFGMember>): string => memberList.length ? memberList.map((member) => `\`${member.name}\` - <@${member.id}>`).join('\n') : noMembersStr;
|
||||
export const generateMemberList = (memberList: Array<LFGMember>): string =>
|
||||
memberList.length ? memberList.map((member) => `${escapeMemberNameForDisplay(member.name)} - <@${member.id}>`).join('\n') : noMembersStr;
|
||||
export const generateAlternateList = (alternateList: Array<LFGMember>): string =>
|
||||
alternateList.length ? alternateList.map((member) => `\`${member.name}\` - <@${member.id}>${member.joined ? ' *' : ''}`).join('\n') : noMembersStr;
|
||||
alternateList.length ? alternateList.map((member) => `${escapeMemberNameForDisplay(member.name)} - <@${member.id}>${member.joined ? ' *' : ''}`).join('\n') : noMembersStr;
|
||||
|
||||
// Fields for event creation and editing modals
|
||||
export const eventTimeId = 'eventTime';
|
||||
|
|
Loading…
Reference in New Issue