Unverified Commit 1cbb7d41 authored by tec's avatar tec

Improve account link messages

parent 6da60452
......@@ -22,7 +22,9 @@ pub fn new_member(ctx: &Context, mut new_member: Member) {
message.push_line("You should also know that we follow the Freenode Channel Guidelines: https://freenode.net/changuide, and try to avoid defamatory content.");
message.push_line("Make sure to check out ");
message.mention(&CONFIG.readme_channel);
message.push_line(" to get yourself some roles for directed pings 😊");
message.push_line(" to get yourself some roles for directed pings 😊, and ");
message.push_mono(format!("{}register username", CONFIG.command_prefix));
message.push_line(" to link to your UCC account.");
send_message!(CONFIG.welcome_channel, &ctx, message.build());
let mut message = MessageBuilder::new();
......@@ -100,15 +102,14 @@ impl Commands {
);
return;
}
match msg.channel_id.say(
send_message!(
msg.channel_id,
&ctx.http,
format!("Ok {}, I've sent an email to you :)", account_name),
) {
Ok(new_msg) => {
e!("Failed to delete message: {:?}", new_msg.delete(&ctx));
}
Err(why) => error!("Error sending message: {:?}", why),
}
format!(
"Ok {}, see the email I've just sent you to complete the link",
account_name
)
);
e!("Error deleting register message: {:?}", msg.delete(ctx));
......@@ -128,7 +129,7 @@ impl Commands {
.stdin(message.stdout.unwrap())
.output()
{
Ok(_) => {}
Ok(_) => info!("Email sent to {}", account_name),
Err(why) => error!("Unable to send message with mutt {:?}", why),
};
}
......@@ -156,10 +157,13 @@ impl Commands {
m
})
);
send_delete_message!(
let mut verification_message = MessageBuilder::new();
verification_message.push(format!("Verification was sucessful {}. To proide a friendly introduction to yourself consider doing ", &full_member.username));
verification_message.push_mono(format!("{}set bio <info>", CONFIG.command_prefix));
send_message!(
msg.channel_id,
ctx.http.clone(),
"Verification sucessful"
verification_message.build()
);
})
);
......
......@@ -17,12 +17,18 @@ impl Commands {
create_motion(&ctx, &msg, motion);
return;
}
send_message!(msg.channel_id, &ctx.http,
"If there's something you want to motion, put it after the !move keyword");
send_message!(
msg.channel_id,
&ctx.http,
"If there's something you want to motion, put it after the !move keyword"
);
}
pub fn motion(ctx: Context, msg: Message, _content: &str) {
send_message!(msg.channel_id, &ctx.http,
"I hope you're not having a motion. You may have wanted to !move something instead.");
send_message!(
msg.channel_id,
&ctx.http,
"I hope you're not having a motion. You may have wanted to !move something instead."
);
}
pub fn poll(ctx: Context, msg: Message, content: &str) {
let topic = content;
......@@ -30,8 +36,11 @@ impl Commands {
create_poll(&ctx, &msg, topic);
return;
}
send_message!(msg.channel_id, &ctx.http,
"If there's something you want to motion, put it after the !move keyword");
send_message!(
msg.channel_id,
&ctx.http,
"If there's something you want to motion, put it after the !move keyword"
);
}
pub fn cowsay(ctx: Context, msg: Message, content: &str) {
let output = if !content.trim().is_empty() {
......@@ -240,9 +249,9 @@ fn update_motion(
);
let update_status = |e: &mut serenity::builder::CreateEmbed,
status: &str,
last_status_full: String,
topic: &str| {
status: &str,
last_status_full: String,
topic: &str| {
let last_status = last_status_full.lines().next().expect("No previous status");
if last_status == status {
e.field("Status", last_status_full, true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment