There is type -q , as in
if type -q $program
which returns 0 if something is a function, an internal or external program (i.e. if it is something that will make fish).
There is also command -sq which will return 0 only if it is an external program.
For both of them, the -q flag disables all output. For the -s command, it forces it to simply look for the command, and not execute it directly.
source share