Skip to main content
Version: Current

Bots.UpdateBotAsync

Description​

Update the details about the specified Assistant Buddy.

Signature [C#]​

Task UpdateBotAsync(BotInfo botInfo);

Properties​

Input​

PropertyDescription
BotInfoSpecify the details of the Assistant Buddy

Remarks​

Use UpdateBotAsync API to update information about the Assistant Buddy.

Example​

C#
public async Task UpdateAssistantBuddy()
{
IControlRoomContext context = LoginControlRoom();
try
{
int botId = 1;
string updateBotName = "updateBot";
var existingBot = await context.Bots.GetBotByIdAsync(botId);
BotInfo botInfo = new BotInfo()
{
BotId = botId,
RegAppsId = existingBot.RegAppsId,
BotName = updateBotName,
ExecStatusId = 1,
BotGuid = existingBot.BotGuid
};
await context.Bots.UpdateBotAsync(botInfo);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}

See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.