Skip to content

Commit

Permalink
Add selected bot groups to suggested parameters
Browse files Browse the repository at this point in the history
Closes #1682
  • Loading branch information
MrBurrBurr committed Dec 25, 2024
1 parent 6be2406 commit 0da8210
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/views/Commands.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,15 @@
case '[bots]':
case '<targetbot>':
// eslint-disable-next-line no-case-declarations
const suggestedBot = [...this.$store.getters['bots/bots'].map(bot => bot.name), 'ASF']
const botGroups = ['ASF', '@ALL', '@FARMING', '@IDLE', '@OFFLINE', '@ONLINE'];
// eslint-disable-next-line no-case-declarations
const suggestedBot = [...this.$store.getters['bots/bots'].map(bot => bot.name), ...botGroups]
.find(name => name.startsWith(this.currentParameterValue));
if (suggestedBot) return suggestedBot;
return [...this.$store.getters['bots/bots'].map(bot => bot.name), 'ASF']
return [...this.$store.getters['bots/bots'].map(bot => bot.name), ...botGroups]
.find(name => name.toLowerCase().startsWith(this.currentParameterValue.toLowerCase()));
case '<command>':
return this.allCommandsNames.find(name => name.startsWith(this.currentParameterValue));
Expand Down

0 comments on commit 0da8210

Please sign in to comment.