Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ash
Discord Bot
Commits
b7548e5e
Commit
b7548e5e
authored
Aug 05, 2019
by
tec
Browse files
No empty motions
parent
b52907ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main.rs
View file @
b7548e5e
...
...
@@ -57,7 +57,16 @@ impl EventHandler for Handler {
let
mut
iter
=
msg
.content
.chars
();
iter
.by_ref
()
.nth
(
5
);
let
topic
=
iter
.as_str
();
create_motion
(
&
ctx
,
&
msg
,
topic
);
if
topic
==
""
{
if
let
Err
(
why
)
=
msg
.channel_id
.say
(
&
ctx
.http
,
"If there's something you want to motion, put it after the !move keyword"
,
)
{
println!
(
"Error sending message: {:?}"
,
why
);
}
}
else
{
create_motion
(
&
ctx
,
&
msg
,
topic
);
}
}
else
if
msg
.content
.starts_with
(
"!motion"
)
{
if
let
Err
(
why
)
=
msg
.channel_id
.say
(
&
ctx
.http
,
"I hope you're not having a motion. You may have wanted to !move something instead."
)
{
println!
(
"Error sending message: {:?}"
,
why
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment