Skip to content

Commit

Permalink
Move replace below, isset check.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesJJT committed Mar 28, 2024
1 parent 6b5b793 commit e617822
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/commands/hubsupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ export default {
),
async execute (interaction) {
let value = interaction.options.getString('name')
// Replace spaces with dashes to fix an issue with spaces not returning anything
value = value.replace(/\s+/g, '-')

if (!value) {
return interaction.followUp('Support for hub plugins should be directed to the author of the plugin.\nYou can find the support link by searching for the plugin in the Plugin Hub panel and clicking the `?` button on the plugin, or by right-clicking the plugin in the plugin panel and clicking the `Support` menu option.')
}

// Replace spaces with dashes to fix an issue with spaces not returning anything
value = value.replace(/\s+/g, '-')

const manifest = await fetchManifest()
const plugin = manifest.display.find(p => p.internalName === value)

Expand Down

0 comments on commit e617822

Please sign in to comment.