C# Class SteamChatBot.Triggers.BaseTrigger

Exibir arquivo Open project: Steam-Chat-Bot/SteamChatBot

Public Properties

Property Type Description
ReplyEnabled bool

Public Methods

Method Description
BaseTrigger ( TriggerType type, string name, TriggerOptionsBase options ) : System
OnAnnouncement ( SteamID groupID, string headline, bool haveEatenEvent ) : bool

When a group makes an announcement

OnBannedChat ( SteamID roomID, SteamID bannedID, SteamID bannerID, bool haveSentMessage ) : bool

Returns true if a message was sent

OnChatInvite ( SteamID roomID, string roomName, SteamID inviterID ) : bool

Return true if the invite is accepted

OnChatMessage ( SteamID roomID, SteamID chatterID, string message, bool haveSentMessage ) : bool

Return true if a message was sent

OnDisconnected ( SteamID roomID, SteamID userID, bool haveSentMessage ) : bool

Returns true if a message was sent

OnEnteredChat ( SteamID roomID, SteamID userID, bool haveSentMessage ) : bool

Return true if a message was sent

OnFriendMessage ( SteamID userID, string message, bool haveSentMessage ) : bool

Return true if a message was sent

OnFriendRequest ( SteamID userID ) : bool

Return true if the request is accepted

OnKickedChat ( SteamID roomID, SteamID kickedID, SteamID kickerID, bool haveSentMessage ) : bool

Return true if a message was sent

OnLeftChat ( SteamID roomID, SteamID userID ) : bool

Return true if a message was sent

OnLoad ( ) : bool

Return true if trigger loads properly

OnLoggedOff ( ) : bool

Reacts to bot being logged off

OnLoggedOn ( ) : bool

Reacts to bot being logged on

OnSentMessage ( SteamID toID, string message, bool haveSentMessage ) : bool

Return true if message was seen but don't want other triggers to see

OnTradeOffer ( int number, bool haveEatenEvent ) : bool

When someone sends a trade offer

OnTradeProposed ( SteamID tradeID, SteamID userID, bool haveEatenEvent ) : bool

When someone sends a trade invite

OnTradeSession ( SteamID userID, bool haveEatenEvent ) : bool

When someone a trade is opened

ReadTriggers ( ) : List

Read triggers from username/triggers/

SaveTrigger ( ) : void

Save current trigger to file

onLoad ( ) : bool
onLoggedOff ( ) : bool
onLoggedOn ( ) : bool
respondToAnnouncement ( SteamID groupID, string headline ) : bool
respondToBan ( SteamID roomID, SteamID bannedId, SteamID bannerId ) : bool
respondToChatInvite ( SteamID roomID, string roomName, SteamID inviterId ) : bool
respondToChatMessage ( SteamID roomID, SteamID chatterId, string message ) : bool
respondToDisconnect ( SteamID roomID, SteamID userID ) : bool
respondToEnteredMessage ( SteamID roomID, SteamID userID ) : bool
respondToFriendMessage ( SteamID userID, string message ) : bool
respondToFriendRequest ( SteamID userID ) : bool
respondToKick ( SteamID roomID, SteamID kickedId, SteamID kickerId ) : bool
respondToLeftMessage ( SteamID roomID, SteamID userID ) : bool
respondToSentMessage ( SteamID toID, string message ) : bool
respondToTradeOffer ( int number ) : bool
respondToTradeProposal ( SteamID tradeId, SteamID steamId ) : bool
respondToTradeSession ( SteamID userID ) : bool

Protected Methods

Method Description
CheckIgnores ( SteamID toID, SteamID fromID ) : bool

Check to see if the user or room is on the ignore list

CheckRoom ( SteamID toID ) : bool

Check to see if the room is on the whitelist

CheckUser ( SteamID fromID ) : bool

Check to see if the user is on the whitelist

DisableForTimeout ( ) : void

Disables bot reply for the duration of the timeout

IfError ( string cbn, string name, string error ) : string

If there is an error, log it easily

RandomRoll ( ) : bool

Randomly decides if a message will be sent

SendMessageAfterDelay ( SteamID steamID, string message, bool room ) : void

Sends a message to the specified SteamID

StripCommand ( string message, string command ) : string[]

Splits the message and returns an array of words

Private Methods

Method Description
AfterTimer_Timeout ( object sender, System.Timers.ElapsedEventArgs e ) : void
TimerElapsed_Message ( object sender, System.Timers.ElapsedEventArgs e, SteamID steamID, string message, bool room ) : void

Method Details

BaseTrigger() public method

public BaseTrigger ( TriggerType type, string name, TriggerOptionsBase options ) : System
type TriggerType
name string
options SteamChatBot.Triggers.TriggerOptions.TriggerOptionsBase
return System

CheckIgnores() protected method

Check to see if the user or room is on the ignore list
protected CheckIgnores ( SteamID toID, SteamID fromID ) : bool
toID SteamKit2.SteamID
fromID SteamKit2.SteamID
return bool

CheckRoom() protected method

Check to see if the room is on the whitelist
protected CheckRoom ( SteamID toID ) : bool
toID SteamKit2.SteamID
return bool

CheckUser() protected method

Check to see if the user is on the whitelist
protected CheckUser ( SteamID fromID ) : bool
fromID SteamKit2.SteamID
return bool

DisableForTimeout() protected method

Disables bot reply for the duration of the timeout
protected DisableForTimeout ( ) : void
return void

IfError() protected method

If there is an error, log it easily
protected IfError ( string cbn, string name, string error ) : string
cbn string
name string
error string
return string

OnAnnouncement() public method

When a group makes an announcement
public OnAnnouncement ( SteamID groupID, string headline, bool haveEatenEvent ) : bool
groupID SteamKit2.SteamID
headline string
haveEatenEvent bool
return bool

OnBannedChat() public method

Returns true if a message was sent
public OnBannedChat ( SteamID roomID, SteamID bannedID, SteamID bannerID, bool haveSentMessage ) : bool
roomID SteamKit2.SteamID
bannedID SteamKit2.SteamID
bannerID SteamKit2.SteamID
haveSentMessage bool
return bool

OnChatInvite() public method

Return true if the invite is accepted
public OnChatInvite ( SteamID roomID, string roomName, SteamID inviterID ) : bool
roomID SteamKit2.SteamID
roomName string
inviterID SteamKit2.SteamID
return bool

OnChatMessage() public method

Return true if a message was sent
public OnChatMessage ( SteamID roomID, SteamID chatterID, string message, bool haveSentMessage ) : bool
roomID SteamKit2.SteamID
chatterID SteamKit2.SteamID
message string
haveSentMessage bool
return bool

OnDisconnected() public method

Returns true if a message was sent
public OnDisconnected ( SteamID roomID, SteamID userID, bool haveSentMessage ) : bool
roomID SteamKit2.SteamID
userID SteamKit2.SteamID
haveSentMessage bool
return bool

OnEnteredChat() public method

Return true if a message was sent
public OnEnteredChat ( SteamID roomID, SteamID userID, bool haveSentMessage ) : bool
roomID SteamKit2.SteamID
userID SteamKit2.SteamID
haveSentMessage bool
return bool

OnFriendMessage() public method

Return true if a message was sent
public OnFriendMessage ( SteamID userID, string message, bool haveSentMessage ) : bool
userID SteamKit2.SteamID
message string
haveSentMessage bool
return bool

OnFriendRequest() public method

Return true if the request is accepted
public OnFriendRequest ( SteamID userID ) : bool
userID SteamKit2.SteamID
return bool

OnKickedChat() public method

Return true if a message was sent
public OnKickedChat ( SteamID roomID, SteamID kickedID, SteamID kickerID, bool haveSentMessage ) : bool
roomID SteamKit2.SteamID
kickedID SteamKit2.SteamID
kickerID SteamKit2.SteamID
haveSentMessage bool
return bool

OnLeftChat() public method

Return true if a message was sent
public OnLeftChat ( SteamID roomID, SteamID userID ) : bool
roomID SteamKit2.SteamID
userID SteamKit2.SteamID
return bool

OnLoad() public method

Return true if trigger loads properly
public OnLoad ( ) : bool
return bool

OnLoggedOff() public method

Reacts to bot being logged off
public OnLoggedOff ( ) : bool
return bool

OnLoggedOn() public method

Reacts to bot being logged on
public OnLoggedOn ( ) : bool
return bool

OnSentMessage() public method

Return true if message was seen but don't want other triggers to see
public OnSentMessage ( SteamID toID, string message, bool haveSentMessage ) : bool
toID SteamKit2.SteamID
message string
haveSentMessage bool
return bool

OnTradeOffer() public method

When someone sends a trade offer
public OnTradeOffer ( int number, bool haveEatenEvent ) : bool
number int
haveEatenEvent bool
return bool

OnTradeProposed() public method

When someone sends a trade invite
public OnTradeProposed ( SteamID tradeID, SteamID userID, bool haveEatenEvent ) : bool
tradeID SteamKit2.SteamID
userID SteamKit2.SteamID
haveEatenEvent bool
return bool

OnTradeSession() public method

When someone a trade is opened
public OnTradeSession ( SteamID userID, bool haveEatenEvent ) : bool
userID SteamKit2.SteamID
haveEatenEvent bool
return bool

RandomRoll() protected method

Randomly decides if a message will be sent
protected RandomRoll ( ) : bool
return bool

ReadTriggers() public static method

Read triggers from username/triggers/
public static ReadTriggers ( ) : List
return List

SaveTrigger() public method

Save current trigger to file
public SaveTrigger ( ) : void
return void

SendMessageAfterDelay() protected method

Sends a message to the specified SteamID
protected SendMessageAfterDelay ( SteamID steamID, string message, bool room ) : void
steamID SteamKit2.SteamID
message string
room bool
return void

StripCommand() protected method

Splits the message and returns an array of words
protected StripCommand ( string message, string command ) : string[]
message string
command string
return string[]

onLoad() public method

public onLoad ( ) : bool
return bool

onLoggedOff() public method

public onLoggedOff ( ) : bool
return bool

onLoggedOn() public method

public onLoggedOn ( ) : bool
return bool

respondToAnnouncement() public method

public respondToAnnouncement ( SteamID groupID, string headline ) : bool
groupID SteamKit2.SteamID
headline string
return bool

respondToBan() public method

public respondToBan ( SteamID roomID, SteamID bannedId, SteamID bannerId ) : bool
roomID SteamKit2.SteamID
bannedId SteamKit2.SteamID
bannerId SteamKit2.SteamID
return bool

respondToChatInvite() public method

public respondToChatInvite ( SteamID roomID, string roomName, SteamID inviterId ) : bool
roomID SteamKit2.SteamID
roomName string
inviterId SteamKit2.SteamID
return bool

respondToChatMessage() public method

public respondToChatMessage ( SteamID roomID, SteamID chatterId, string message ) : bool
roomID SteamKit2.SteamID
chatterId SteamKit2.SteamID
message string
return bool

respondToDisconnect() public method

public respondToDisconnect ( SteamID roomID, SteamID userID ) : bool
roomID SteamKit2.SteamID
userID SteamKit2.SteamID
return bool

respondToEnteredMessage() public method

public respondToEnteredMessage ( SteamID roomID, SteamID userID ) : bool
roomID SteamKit2.SteamID
userID SteamKit2.SteamID
return bool

respondToFriendMessage() public method

public respondToFriendMessage ( SteamID userID, string message ) : bool
userID SteamKit2.SteamID
message string
return bool

respondToFriendRequest() public method

public respondToFriendRequest ( SteamID userID ) : bool
userID SteamKit2.SteamID
return bool

respondToKick() public method

public respondToKick ( SteamID roomID, SteamID kickedId, SteamID kickerId ) : bool
roomID SteamKit2.SteamID
kickedId SteamKit2.SteamID
kickerId SteamKit2.SteamID
return bool

respondToLeftMessage() public method

public respondToLeftMessage ( SteamID roomID, SteamID userID ) : bool
roomID SteamKit2.SteamID
userID SteamKit2.SteamID
return bool

respondToSentMessage() public method

public respondToSentMessage ( SteamID toID, string message ) : bool
toID SteamKit2.SteamID
message string
return bool

respondToTradeOffer() public method

public respondToTradeOffer ( int number ) : bool
number int
return bool

respondToTradeProposal() public method

public respondToTradeProposal ( SteamID tradeId, SteamID steamId ) : bool
tradeId SteamKit2.SteamID
steamId SteamKit2.SteamID
return bool

respondToTradeSession() public method

public respondToTradeSession ( SteamID userID ) : bool
userID SteamKit2.SteamID
return bool

Property Details

ReplyEnabled public_oe property

public bool ReplyEnabled
return bool