Alchemy.Cogs.disable
You're seeing just the function
disable
, go back to Alchemy.Cogs module for more information.
Link to this function
disable(command)
Specs
disable(atom()) :: :ok
Disables a command.
If you want to remove a whole module from the cogs, use Cogs.unload/1
.
This will stop a command from being triggered. The only way to reenable the
command is to reload the module with use
.
Examples
defmodule Example do
use Alchemy.Cogs
Cogs.def ping, do: Cogs.say "pong"
Cogs.def foo, do: Cogs.say "bar"
end
Client.start(@token)
use Example
Cogs.disable(:foo)
Only ping
will be triggerable now.
use Example
At runtime this will add foo
back in, given it's still in the module.