Added configuration for setting roles to ping

master
Joey Hines 2020-07-09 22:05:01 -05:00
parent 19c8ad8c80
commit 250b05405f
2 changed files with 9 additions and 1 deletions

View File

@ -97,6 +97,13 @@ pub fn send_event_msg(
let native_time = utc_time.with_timezone(&config.event_timezone);
let ping_roles = &config.ping_roles;
let mut ping_roles_msg = String::new();
for role in ping_roles {
ping_roles_msg.push_str(format!(" <@&{}>", role).as_str());
}
// Send message
let msg = channel.id().send_message(&http, |m| {
m.embed(|e| {
@ -114,7 +121,7 @@ pub fn send_event_msg(
.timestamp(utc_time.to_rfc3339())
.field("Location", &event.event_loc, true)
.field("Organizer", &event.organizer, true)
})
}).content(ping_roles_msg)
})?;
if react {

View File

@ -13,6 +13,7 @@ pub struct HypeBotConfig {
pub prefix: String,
pub event_channel: u64,
pub event_roles: Vec<u64>,
pub ping_roles: Vec<u64>,
#[serde(deserialize_with = "from_tz_string")]
pub event_timezone: Tz,
pub log_path: String,