Bots.GetBotByNameAsync
Description
Gets the details about Assistant Buddy having the specified name
Signature [C#]
Task<BotInfo> GetBotByNameAsync(string botName, AppName appName);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
botName | string | Required | Specify the Assistant Buddy's name to retrieve whose information. |
appName | AppName | Required | Specify the app name |
Output
| Type | Description |
|---|---|
| BotInfo | Returns the information of the requested Assistant Buddy |
Remarks
Use GetBotByNameAsync API to return information about the Assistant Buddy's specified name.
Example
C#
public async Task GetAssistantBuddyByName()
{
IControlRoomContext context = LoginControlRoom();
try
{
string botName = "IB-166";
BotInfo botInfo = await context.Bots.GetBotByNameAsync(botName, AppName.AssistantBuddy);
Console.WriteLine("BotName: " + botInfo.BotName);
}
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.