Skip to content

Commit 80fb575

Browse files
committed
0.6.0 changes, new triggers, bug fixes, etc
1 parent 2e35e99 commit 80fb575

20 files changed

Lines changed: 552 additions & 200 deletions

SteamChatBot/Bot.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,16 @@ public static void WriteData()
9292
Directory.CreateDirectory(username + "/");
9393
}
9494
File.WriteAllText(username + "/login.json", json);
95-
File.AppendAllText("chatbots.txt", username + "\n");
96-
File.SetAttributes("chatbots.txt", File.GetAttributes("chatbots.txt") | FileAttributes.Hidden);
95+
96+
if(!File.Exists("chatbots.txt"))
97+
{
98+
File.Create("chatbots.txt");
99+
}
100+
101+
if (!File.ReadAllText("chatbots.txt").Contains(username + "\n"))
102+
{
103+
File.AppendAllText("chatbots.txt", username + "\n");
104+
}
97105
}
98106

99107
#endregion
@@ -180,6 +188,11 @@ public static void Start(string _username, string _password, string cll, string
180188

181189
isRunning = true;
182190

191+
foreach(BaseTrigger trigger in triggers)
192+
{
193+
trigger.OnLoad();
194+
}
195+
183196
Log.Instance.Silly("Updating SteamKit2 servers...");
184197
SteamDirectory.Initialize().Wait();
185198

SteamChatBot/Log.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected void _OutputLine(LogLevel level, string line, params object[] formatPa
125125
{
126126
if (disposed)
127127
return;
128-
string formattedString = String.Format(
128+
string formattedString = string.Format(
129129
"[{0}{1}] {2}: {3}",
130130
GetLogBotName(),
131131
DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),

SteamChatBot/MainWindow.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,25 @@
6060
<ListBoxItem x:Name="autojoinChatTrigger" Content="AutojoinChatTrigger - Autojoins chat room(s)"/>
6161
<ListBoxItem x:Name="banTrigger" Content="BanTrigger - Bans a user from chat"/>
6262
<ListBoxItem x:Name="banCheckTrigger" Content="BanCheckTrigger - Checks SteamCommunity for bans"/>
63+
<ListBoxItem x:Name="changeNameTrigger" Content="ChangeNameTrigger - Changes the bots name"/>
6364
<ListBoxItem x:Name="chatReplyTrigger" Content="ChatReplyTrigger - Responds to a match in chat"/>
6465
<ListBoxItem x:Name="discordTrigger" Content="DiscordTrigger - Discord Relay for Steam Chat"/>
6566
<ListBoxItem x:Name="doormatTrigger" Content="DoormatTrigger - Greets a user as they enter chat"/>
67+
<ListBoxItem x:Name="googleTrigger" Content="GoogleTrigger - Searches google and returns the top result"/>
6668
<ListBoxItem x:Name="isUpTrigger" Content="IsUpTrigger - Determines if a website is online"/>
6769
<ListBoxItem x:Name="kickTrigger" Content="KickTrigger - Kicks a SteamID from chat"/>
6870
<ListBoxItem x:Name="leaveChatTrigger" Content="LeaveChatTrigger - Commands the bot to leave chat"/>
6971
<ListBoxItem x:Name="linkNameTrigger" Content="LinkNameTrigger - Gets the title of the website from a link"/>
7072
<ListBoxItem x:Name="lockChatTrigger" Content="LockChatTrigger - Locks the chat room"/>
73+
<ListBoxItem x:Name="messageIntervalTrigger" Content="MessageIntervalTrigger - Sends a message to a chat room every time the interval passes"/>
7174
<ListBoxItem x:Name="moderateChatTrigger" Content="ModerateChatTrigger - Moderates a chat room"/>
7275
<ListBoxItem x:Name="noteTrigger" Content="NoteTrigger - Saves notes than can be accessed by anyone in the chat"/>
7376
<ListBoxItem x:Name="notificationTrigger" Content="NotificationTrigger - Sends users notifications"/>
7477
<ListBoxItem x:Name="playGameTrigger" Content="PlayGameTrigger - Plays a game (AppID)"/>
7578
<ListBoxItem x:Name="unbanTrigger" Content="UnbanTrigger - Unbans a user from chat"/>
7679
<ListBoxItem x:Name="unmoderateChatTrigger" Content="UnmoderateChatTrigger - Unmoderates the chat"/>
7780
<ListBoxItem x:Name="weatherTrigger" Content="WeatherTrigger - Gets the weather for a certain location"/>
81+
<ListBoxItem x:Name="youtubeTrigger" Content="YoutubeTrigger - Query youtube for the top video result"/>
7882
</ListBox>
7983
<Button x:Name="minusTriggerButton" Content="-" Grid.Column="1" HorizontalAlignment="Left" Margin="208,428,0,0" VerticalAlignment="Top" Width="44" FontSize="14.667" Click="minusTriggerButton_Click" Height="27"/>
8084
<ListBox x:Name="addedTriggersListBox" Grid.Column="2" HorizontalAlignment="Left" Height="418" Margin="75,10,0,0" VerticalAlignment="Top" Width="275"/>

0 commit comments

Comments
 (0)