I am trying to make a Discord bot using the Sword API on Discord. There aren't really any tutorials for this sort of thing so I've been following along with a channel called The Source Code on YouTube as best I can. The only problem here is that the author of this video uses node.js.
As Swift is my first language, I would like to build a few things with it before starting other languages.
I'm currently building a command handler and am fairly comfortable with debugging, classes and subclasses. My problem now is that I'm trying to tell my bot to look at a particular directory for a particular file extension and I'm stuck on how to do this without hardcoding my file path.
One way I've thought to do this is by jamming all my .json and .swift (excluding main.swift) files into my build directory and using
Bundle.main.url to find/filter files. The only issue with this is the potential of losing all that work if I need to run
Cmd + Shift + K to clean my build directory.
I've found a potential solution in the video below however it makes use of node.js which I am not comfortable with. Would someone be able to break down the two sections of the video linked below and how I can accomplish this task in Swift?
I'm using Xcode 10 on a 2011 MBP with Swift 4.2