feature: custom prefix for steam & discord
Description
Custom prefix for steam and discord configured in options.json
options.miscSettings.prefixes.steamoptions.miscSettings.prefixes.discord
Changes
- Updated schema validation for prefixes options
- Updated logic for custom prefixes
- Updated all messages with static fixed prefix to custom prefix
To do
- Update wiki
- Test cases for safety
- Tested locally and worked what I could see, but rather new to the system so should test everything to see it works as intended
Extra
Fixes: #1354
Wanted to create %prefix% for messages on bptf.
Thank you for the PR. I will look into this.
Interesting to see this. When I was implementing Discord interface from scratch, there were some discussions about differentiating bots by their prefixes, but that time we decided to manage it by differentiating Discord channels bots have access to.
I have some vague ideas about OOP-reworking command interface to make managing commands easier for programmers, as well as moving to slash-commands in Discord. Howewer, your PR might be good for some users for now.
Interesting to see this. When I was implementing Discord interface from scratch, there were some discussions about differentiating bots by their prefixes, but that time we decided to manage it by differentiating Discord channels bots have access to.
I have some vague ideas about OOP-reworking command interface to make managing commands easier for programmers, as well as moving to slash-commands in Discord. Howewer, your PR might be good for some users for now.
I thought about making a whole module for commands and extensions for it but I'm selfish and don't need it. But hopefully it will in the future since the current way of handling commands scares me, would be easier to have them into classes and have a CommandHandler containing all the commands.
Wouldn't it be better to refactor the whole command system, using if statements to check what command the user is using is too much bloat code, wouldn't it save more time to create a Command class with a CommandHandler getting our message if it's a command request and find our command in a map/array to which have been cached on bootstrap?
Would be easier to handle issues like this prefix issues because going around finding where ! is used will be too much repeating process, to avoid DRY so to say.
If you're able to do that, sure, but let this PR get merged first, and I'll give you a write permission on the main repository so that you'll be able to create another branch for that.