|
|
@ -12,7 +12,7 @@ impl CommandSetRoomDescription {
|
|
|
|
pub fn dispatch_delete(&self, args: String, token: Token, db: &mut Db) -> SendQueue {
|
|
|
|
pub fn dispatch_delete(&self, args: String, token: Token, db: &mut Db) -> SendQueue {
|
|
|
|
// make sure something was provided
|
|
|
|
// make sure something was provided
|
|
|
|
if args.is_empty() {
|
|
|
|
if args.is_empty() {
|
|
|
|
return SendQueue(vec![(token, "Delete which line?".into(), true, None)].into());
|
|
|
|
return (token, "Delete which line?").into();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// try and get the line number
|
|
|
|
// try and get the line number
|
|
|
@ -30,7 +30,7 @@ impl CommandSetRoomDescription {
|
|
|
|
|
|
|
|
|
|
|
|
// make sure description has enough lines
|
|
|
|
// make sure description has enough lines
|
|
|
|
if line_num > room.description.len().into() || line_num <= 0 {
|
|
|
|
if line_num > room.description.len().into() || line_num <= 0 {
|
|
|
|
return SendQueue(vec![(token, "Line doeesn't exist".into(), true, None)].into());
|
|
|
|
return (token, "Line doesn't exist").into();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// remove the line and save
|
|
|
|
// remove the line and save
|
|
|
|