@@ -47,9 +47,9 @@ public BaseTrigger(TriggerType type, string name, TriggerOptionsBase options)
4747 /// <param name="name"></param>
4848 /// <param name="error"></param>
4949 /// <returns>error string</returns>
50- protected string IfError ( string cbn , string name , string error )
50+ protected string IfError ( string cbn , string name , Exception error )
5151 {
52- return string . Format ( "{0}/{1}: Error : {2 }" , cbn , name , error ) ;
52+ return string . Format ( "{0}/{1}: {2} : {3 }" , cbn , name , error . Message , error . StackTrace ) ;
5353 }
5454
5555 #region trigger read-write
@@ -139,6 +139,9 @@ public static List<BaseTrigger> ReadTriggers()
139139 case TriggerType . ChatReplyTrigger :
140140 temp . Add ( new ChatReplyTrigger ( type , name , options ) ) ;
141141 break ;
142+ case TriggerType . ChooseTrigger :
143+ temp . Add ( new ChooseTrigger ( type , name , options ) ) ;
144+ break ;
142145 case TriggerType . DiscordTrigger :
143146 temp . Add ( new DiscordTrigger ( type , name , options ) ) ;
144147 break ;
@@ -178,6 +181,9 @@ public static List<BaseTrigger> ReadTriggers()
178181 case TriggerType . PlayGameTrigger :
179182 temp . Add ( new PlayGameTrigger ( type , name , options ) ) ;
180183 break ;
184+ case TriggerType . TranslateTrigger :
185+ temp . Add ( new TranslateTrigger ( type , name , options ) ) ;
186+ break ;
181187 case TriggerType . UnbanTrigger :
182188 temp . Add ( new UnbanTrigger ( type , name , options ) ) ;
183189 break ;
@@ -224,7 +230,7 @@ public virtual bool OnLoad()
224230 }
225231 catch ( Exception e )
226232 {
227- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
233+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
228234 return false ;
229235 }
230236 }
@@ -241,7 +247,7 @@ public virtual bool OnLoggedOn()
241247 }
242248 catch ( Exception e )
243249 {
244- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
250+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
245251 return false ;
246252 }
247253 }
@@ -258,7 +264,7 @@ public virtual bool OnLoggedOff()
258264 }
259265 catch ( Exception e )
260266 {
261- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
267+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
262268 return false ;
263269 }
264270 }
@@ -280,7 +286,7 @@ public virtual bool OnChatInvite(SteamID roomID, string roomName, SteamID invite
280286 }
281287 catch ( Exception e )
282288 {
283- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
289+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
284290 return false ;
285291 }
286292 }
@@ -300,7 +306,7 @@ public virtual bool OnFriendRequest(SteamID userID)
300306 }
301307 catch ( Exception e )
302308 {
303- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
309+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
304310 return false ;
305311 }
306312 }
@@ -328,7 +334,7 @@ public virtual bool OnFriendMessage(SteamID userID, string message, bool haveSen
328334 }
329335 catch ( Exception e )
330336 {
331- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
337+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
332338 return false ;
333339 }
334340 }
@@ -354,7 +360,7 @@ public virtual bool OnTradeOffer(int number, bool haveEatenEvent)
354360 }
355361 catch ( Exception e )
356362 {
357- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
363+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
358364 return false ;
359365 }
360366 }
@@ -381,7 +387,7 @@ public virtual bool OnTradeProposed(SteamID tradeID, SteamID userID, bool haveEa
381387 }
382388 catch ( Exception e )
383389 {
384- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
390+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
385391 return false ;
386392 }
387393 }
@@ -407,7 +413,7 @@ public virtual bool OnTradeSession(SteamID userID, bool haveEatenEvent)
407413 }
408414 catch ( Exception e )
409415 {
410- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
416+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
411417 return false ;
412418 }
413419 }
@@ -434,7 +440,7 @@ public virtual bool OnAnnouncement(SteamID groupID, string headline, bool haveEa
434440 }
435441 catch ( Exception e )
436442 {
437- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
443+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
438444 return false ;
439445 }
440446 }
@@ -461,7 +467,7 @@ public virtual bool OnSentMessage(SteamID toID, string message, bool haveSentMes
461467 }
462468 catch ( Exception e )
463469 {
464- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
470+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
465471 return false ;
466472 }
467473 }
@@ -490,7 +496,7 @@ public virtual bool OnChatMessage(SteamID roomID, SteamID chatterID, string mess
490496 }
491497 catch ( Exception e )
492498 {
493- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
499+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
494500 return false ;
495501 }
496502 }
@@ -519,7 +525,7 @@ public virtual bool OnEnteredChat(SteamID roomID, SteamID userID, bool haveSentM
519525 }
520526 catch ( Exception e )
521527 {
522- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
528+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
523529 return false ;
524530 }
525531 }
@@ -548,7 +554,7 @@ public virtual bool OnKickedChat(SteamID roomID, SteamID kickedID, SteamID kicke
548554 }
549555 catch ( Exception e )
550556 {
551- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
557+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
552558 return false ;
553559 }
554560 }
@@ -577,7 +583,7 @@ public virtual bool OnBannedChat(SteamID roomID, SteamID bannedID, SteamID banne
577583 }
578584 catch ( Exception e )
579585 {
580- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
586+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
581587 return false ;
582588 }
583589 }
@@ -606,7 +612,7 @@ public virtual bool OnDisconnected(SteamID roomID, SteamID userID, bool haveSent
606612 }
607613 catch ( Exception e )
608614 {
609- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
615+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
610616 return false ;
611617 }
612618 }
@@ -634,7 +640,7 @@ public virtual bool OnLeftChat(SteamID roomID, SteamID userID)
634640 }
635641 catch ( Exception e )
636642 {
637- Log . Instance . Error ( IfError ( Bot . username , Name , e . StackTrace ) ) ;
643+ Log . Instance . Error ( IfError ( Bot . username , Name , e ) ) ;
638644 return false ;
639645 }
640646 }
0 commit comments