@@ -21,7 +21,16 @@ class ProgramEnvironment;
2121
2222
2323
24- // Raw Notification
24+ // Send raw Discord notification according to the notification settings.
25+ // Can control the message sidebar color, message title, and message body.
26+ // messages: vector<pair<string, string>>, the sections of the Discord message.
27+ // The first string in the pair is the section title (will shown as bold) while the second
28+ // string is the section content.
29+ // e.g. {{"Message:", {"This is a message."}}} will shown as (in Markdown):
30+ // **Message**
31+ // This is a message.
32+ // The function will add an additional section "Powered By".
33+ // filepath: send the file as a message attachment.
2534void send_raw_program_notification_with_file (
2635 Logger& logger, EventNotificationOption& settings,
2736 Color color,
@@ -30,6 +39,20 @@ void send_raw_program_notification_with_file(
3039 const std::vector<std::pair<std::string, std::string>>& messages,
3140 const std::string& filepath
3241);
42+
43+ // Send raw Discord notification according to the notification settings.
44+ // Can control the message sidebar color, message title, and message body.
45+ // messages: vector<pair<string, string>>, the sections of the Discord message.
46+ // The first string in the pair is the section title (will shown as bold) while the second
47+ // string is the section content.
48+ // e.g. {{"Message:", {"This is a message."}}} will shown as (in Markdown):
49+ // **Message**
50+ // This is a message.
51+ // The function will add an additional section "Powered By".
52+ // image: if not empty, send the screenshot image as part of the message according to the
53+ // notification settings.
54+ // keep_file: if true, the sent image will be saved to the screenshot dir on disk. Otherwise, it
55+ // will be saved to the program TEMP_FOLDER.
3356void send_raw_program_notification (
3457 Logger& logger, EventNotificationOption& settings,
3558 Color color,
@@ -41,7 +64,19 @@ void send_raw_program_notification(
4164
4265
4366
44- // Program notification with stats.
67+ // Send custom Discord notification according to the notification settings.
68+ // Can control the message sidebar color, message title, and message body.
69+ // messages: vector<pair<string, string>>, the sections of the Discord message.
70+ // The first string in the pair is the section title (will shown as bold) while the second
71+ // string is the section content.
72+ // e.g. {{"Message:", {"This is a message."}}} will shown as (in Markdown):
73+ // **Message**
74+ // This is a message.
75+ // The function will add additional sections: "Current Session", "Historical Stats"
76+ // and "Powered By".
77+ // current_stats_addendum: add additional message at the end of the "Current Session" section
78+ // where it shows the current program stats message generated by StatsTracker.
79+ // filepath: send the file as a message attachment.
4580void send_program_notification_with_file (
4681 ProgramEnvironment& env, EventNotificationOption& settings,
4782 Color color,
@@ -50,6 +85,23 @@ void send_program_notification_with_file(
5085 const std::string& current_stats_addendum,
5186 const std::string& filepath
5287);
88+
89+ // Send custom Discord notification according to the notification settings.
90+ // Can control the message sidebar color, message title, and message body.
91+ // messages: vector<pair<string, string>>, the sections of the Discord message.
92+ // The first string in the pair is the section title (will shown as bold) while the second
93+ // string is the section content.
94+ // e.g. {{"Message:", {"This is a message."}}} will shown as (in Markdown):
95+ // **Message**
96+ // This is a message.
97+ // The function will add additional sections: "Current Session", "Historical Stats"
98+ // and "Powered By".
99+ // current_stats_addendum: add additional message at the end of the "Current Session" section
100+ // where it shows the current program stats message generated by StatsTracker.
101+ // image: if not empty, send the screenshot image as part of the message according to the
102+ // notification settings.
103+ // keep_file: if true, the sent image will be saved to the screenshot dir on disk. Otherwise, it
104+ // will be saved to the program TEMP_FOLDER.
53105bool send_program_notification (
54106 ProgramEnvironment& env, EventNotificationOption& settings,
55107 Color color,
@@ -61,24 +113,42 @@ bool send_program_notification(
61113
62114
63115
64- // Other common program notification types.
116+ // Send Discord notification of the current program status according to the notification settings.
117+ // Can send additional message and screenshot image.
118+ // keep_file: if true, the sent image will be saved to the screenshot dir on disk. Otherwise, it
119+ // will be saved to the program TEMP_FOLDER.
65120void send_program_status_notification (
66121 ProgramEnvironment& env, EventNotificationOption& settings,
67122 const std::string& message = " " ,
68123 const ImageViewRGB32& image = ImageViewRGB32(), bool keep_file = false
69124);
70125
126+ // Send Discord notification that the program has finished according to the notification settings.
127+ // Can send additional message and screenshot image.
128+ // keep_file: if true, the sent image will be saved to the screenshot dir on disk. Otherwise, it
129+ // will be saved to the program TEMP_FOLDER.
71130void send_program_finished_notification (
72131 ProgramEnvironment& env, EventNotificationOption& settings,
73132 const std::string& message = " " ,
74133 const ImageViewRGB32& image = ImageViewRGB32(), bool keep_file = false
75134);
76135
136+ // Send Discord notification that the program has encountered a recoverable error according to the
137+ // notification settings.
138+ // Can send additional message and screenshot image.
139+ // keep_file: if true, the sent image will be saved to the screenshot dir on disk. Otherwise, it
140+ // will be saved to the program TEMP_FOLDER.
77141void send_program_recoverable_error_notification (
78142 ProgramEnvironment& env, EventNotificationOption& settings,
79143 const std::string& message,
80144 const ImageViewRGB32& image = ImageViewRGB32(), bool keep_file = false
81145);
146+
147+ // Send Discord notification that the program has a fatal error according to the notification
148+ // settings.
149+ // Can send additional message and screenshot image.
150+ // keep_file: if true, the sent image will be saved to the screenshot dir on disk. Otherwise, it
151+ // will be saved to the program TEMP_FOLDER.
82152void send_program_fatal_error_notification (
83153 ProgramEnvironment& env, EventNotificationOption& settings,
84154 const std::string& message,
0 commit comments