kxg.tokens.watch_token

kxg.tokens.watch_token(method)[source]

Mark a token extension method that should automatically be called when a token method of the same name is called.

This decorator must only be used on TokenExtension methods, otherwise it will silently do nothing. The reason is that the decorator itself can’t do anything but label the given method, because the token to watch isn’t known at the time of decoration. The method is actually setup to watch a token in the TokenExtension constructor, which searches for the label added here. But other classes won’t make this search and will silently do nothing.