This pull request aims to enhance the handleGuildMessageCreation function by introducing a more flexible URL mapping system. The URLs and their corresponding replacements are externalized, allowing for easy modification and extension without modifying the function itself.
Changes Made:
Moved the URL mapping definitions outside the handleGuildMessageCreation function.
Created an array called urlMappings to hold the URL patterns and replacements.
Modified the function to iterate over the urlMappings array and apply the corresponding replacements to the message content.
Summary:
This pull request aims to enhance the
handleGuildMessageCreation
function by introducing a more flexible URL mapping system. The URLs and their corresponding replacements are externalized, allowing for easy modification and extension without modifying the function itself.Changes Made:
handleGuildMessageCreation
function.urlMappings
to hold the URL patterns and replacements.urlMappings
array and apply the corresponding replacements to the message content.