tgstation-server 6.17.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Tgstation.Server.Api.Models.Internal.ChatBotSettings Class Referenceabstract

Manage the server chat bots. More...

Inheritance diagram for Tgstation.Server.Api.Models.Internal.ChatBotSettings:
Inheritance graph
[legend]
Collaboration diagram for Tgstation.Server.Api.Models.Internal.ChatBotSettings:
Collaboration graph
[legend]

Public Member Functions

ChatConnectionStringBuilderCreateConnectionStringBuilder ()
 Get the ChatConnectionStringBuilder which maps to the ConnectionString.
 
void SetConnectionStringBuilder (ChatConnectionStringBuilder stringBuilder)
 Set the ChatConnectionStringBuilder for the ChatBotSettings. Also updates the ConnectionString.
 

Properties

bool? Enabled [get, set]
 If the connection is enabled.
 
uint? ReconnectionInterval [get, set]
 The time interval in minutes the chat bot attempts to reconnect if Enabled and disconnected. Must not be zero.
 
ushort? ChannelLimit [get, set]
 The maximum number of ChatChannels the ChatBotSettings may contain.
 
ChatProviderProvider [get, set]
 The ChatProvider used for the connection.
 
string? ConnectionString [get, set]
 The information used to connect to the Provider.
 
- Properties inherited from Tgstation.Server.Api.Models.NamedEntity
virtual ? string Name [get, set]
 The name of the entity represented by the NamedEntity.
 
- Properties inherited from Tgstation.Server.Api.Models.EntityId
virtual ? long Id [get, set]
 The ID of the entity.
 

Detailed Description

Manage the server chat bots.

Definition at line 9 of file ChatBotSettings.cs.

Member Function Documentation

◆ CreateConnectionStringBuilder()

ChatConnectionStringBuilder? Tgstation.Server.Api.Models.Internal.ChatBotSettings.CreateConnectionStringBuilder ( )

Get the ChatConnectionStringBuilder which maps to the ConnectionString.

Returns
A ChatConnectionStringBuilder for the ChatBotSettings.

Definition at line 52 of file ChatBotSettings.cs.

53 {
54 if (ConnectionString == null)
55 return null;
56 return Provider switch
57 {
58 ChatProvider.Discord => new DiscordConnectionStringBuilder(ConnectionString),
59 ChatProvider.Irc => new IrcConnectionStringBuilder(ConnectionString),
60 _ => throw new InvalidOperationException("Invalid Provider!"),
61 };
62 }
string? ConnectionString
The information used to connect to the Provider.
ChatProvider? Provider
The ChatProvider used for the connection.

References Tgstation.Server.Api.Models.Internal.ChatBotSettings.ConnectionString, and Tgstation.Server.Api.Models.Internal.ChatBotSettings.Provider.

◆ SetConnectionStringBuilder()

void Tgstation.Server.Api.Models.Internal.ChatBotSettings.SetConnectionStringBuilder ( ChatConnectionStringBuilder  stringBuilder)

Set the ChatConnectionStringBuilder for the ChatBotSettings. Also updates the ConnectionString.

Parameters
stringBuilderThe optional ChatConnectionStringBuilder.

Definition at line 68 of file ChatBotSettings.cs.

69 {
70 ConnectionString = stringBuilder?.ToString() ?? throw new ArgumentNullException(nameof(stringBuilder));
71 }

References Tgstation.Server.Api.Models.Internal.ChatBotSettings.ConnectionString, and Tgstation.Server.Api.Models.Internal.ChatConnectionStringBuilder.ToString().

Here is the call graph for this function:

Property Documentation

◆ ChannelLimit

ushort? Tgstation.Server.Api.Models.Internal.ChatBotSettings.ChannelLimit
getset

The maximum number of ChatChannels the ChatBotSettings may contain.

5

Definition at line 29 of file ChatBotSettings.cs.

29{ get; set; }

Referenced by Tgstation.Server.Host.Models.ChatBot.ToApi().

◆ ConnectionString

string? Tgstation.Server.Api.Models.Internal.ChatBotSettings.ConnectionString
getset

◆ Enabled

bool? Tgstation.Server.Api.Models.Internal.ChatBotSettings.Enabled
getset

If the connection is enabled.

Definition at line 14 of file ChatBotSettings.cs.

14{ get; set; }

Referenced by Tgstation.Server.Host.Models.ChatBot.ToApi().

◆ Provider

ChatProvider? Tgstation.Server.Api.Models.Internal.ChatBotSettings.Provider
getset

◆ ReconnectionInterval

uint? Tgstation.Server.Api.Models.Internal.ChatBotSettings.ReconnectionInterval
getset

The time interval in minutes the chat bot attempts to reconnect if Enabled and disconnected. Must not be zero.

60

Definition at line 22 of file ChatBotSettings.cs.

22{ get; set; }

Referenced by Tgstation.Server.Host.Models.ChatBot.ToApi().


The documentation for this class was generated from the following file: