Bunnyslippers69 wrote:
Bunnyslippers69 wrote:
Aidan New Name Banter wrote:
I'd recommend splitting commands.js into different files (cleaner coding practice see
here for an example).
Ultimatley looks good though, another good practice is avoiding hard coding stuff, in your SSRPItems.cs is the file standing out to me thats hardcoded. Try using a data storing method and creating commands (could be specified to only a certain user or rank that can use this command) where you can add items which should be easier than editing the actual code to add more items. Just a suggestion though I know sometimes people prefer adding it via the code. A config file is also a nice touch to stop people from searching through all your code to modify specific values.
Thanks for the feedback, i'll definitely ocnsider cleaning up the Items file. I'll most likely do that after i've got to a point where i'm fairly certain the bot is finished, as it's not a priority at the moment. It does the job well enough for me to not be too concerned about it right now.
I decided i'd do both the things you mentioned regardless. You can now add/remove items and printers with commands. Cleaned up the commands, spllit them into different files.
Good work, although stuff like
if (Context.Message.Author.ToString() != "Bunny#9220") { await Context.Channel.SendMessageAsync("No permission"); }
Tends to be an insecure method. In theory what would stop someone with discord nitro impersonating your account. You'd be better enabling developer mode on discord and getting your userID and using that. (
discord.js.org/#/docs/main/stable/class/...ence?scrollTo=userID)
I've proposed a new commit to one of your files using your userid, I'd review it beforehand though as its been a while since I've worked with discord bots.