Bragi Docs Help

GetVariable<T>(string name)

This method returns the value a variable in the supplied type of T.

Task<T> GetVariable<T>(string name);

Type Parameter

  • T: The type of the variable to retrieve.

Parameters

  • name: The name of the variable as defined in Bragi

Examples

The below example returns the value of the 'Biscuits Eaten Today' named variable as an integer and logs it. It also returns the value of 'Do anything for love' (but I won't do that) as a string and logs it.

var v1 = await bragiCodeUtil.GetVariable<int>("Biscuits Eaten Today"); var v2 = await bragiCodeUtil.GetVariable<string>("Do anything for love"); bragiCodeUtil.LogInformation(v1.ToString()); bragiCodeUtil.LogInformation(v2);
15 September 2025