You can run tasks by importing Mix.Task
into your module instead of mix run
.
I think this is what you're looking for.
On top of that, instead of mix
, you can simply run mix
to run the default task. Simply add default_task: "bot.run"
into the list of def project do [..] end
in mix.exs
. Refer here.