Not much the builtin tags, but the Discord-related ones (like addrole
, removechannel
etc) are error-prone. To be able to distinguish between an errored tag and a clean tag, we usually print the error text when the tag errors. This allows you to do something like the following:
{% capture adchannel %}{% addchannel "new-channel" %}{% endcapture %}{% assign addchannel = addchannel | truthness %}{%- if addchannel %}The code has an error.{% else %}The channel was created{% endif %}
Basically, we check if the addchannel
tag returns something ( | truthness
does that). If it doesn't, the channel was created, otherwise there must've been an error. If you want to display the error, you must change the name of the variable in the assign
and in the if
condition.