@@ -16,6 +16,7 @@ pub struct Config {
1616 pub tweet_sync : TweetSyncConfig ,
1717 pub tg_bot : TelegramBotConfig ,
1818 pub raid_leaderboard : RaidLeaderboardConfig ,
19+ pub alert : AlertConfig ,
1920}
2021
2122#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -74,6 +75,9 @@ pub struct TweetSyncConfig {
7475 pub interval_in_hours : u64 ,
7576 pub keywords : String ,
7677 pub api_key : String ,
78+ pub monthly_limit : u32 ,
79+ pub alert_threshold : u32 ,
80+ pub reset_day : u32 ,
7781}
7882
7983#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -90,6 +94,11 @@ pub struct RaidLeaderboardConfig {
9094 pub tweets_req_interval_in_secs : u64 ,
9195}
9296
97+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
98+ pub struct AlertConfig {
99+ pub webhook_url : String ,
100+ }
101+
93102impl Config {
94103 pub fn load ( config_path : & str ) -> Result < Self , config:: ConfigError > {
95104 let settings = config:: Config :: builder ( )
@@ -209,6 +218,9 @@ impl Default for Config {
209218 interval_in_hours : 24 ,
210219 keywords : "hello" . to_string ( ) ,
211220 api_key : "key" . to_string ( ) ,
221+ monthly_limit : 15000 ,
222+ alert_threshold : 13000 ,
223+ reset_day : 1 ,
212224 } ,
213225 tg_bot : TelegramBotConfig {
214226 base_url : "https://api.telegram.org" . to_string ( ) ,
@@ -220,6 +232,9 @@ impl Default for Config {
220232 sync_interval_in_hours : 24 ,
221233 tweets_req_interval_in_secs : 60 ,
222234 } ,
235+ alert : AlertConfig {
236+ webhook_url : "https://your-webhook-url.com" . to_string ( ) ,
237+ } ,
223238 }
224239 }
225240}
0 commit comments