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
UCC
Discord Bot
Commits
379f0f2c
Unverified
Commit
379f0f2c
authored
May 26, 2020
by
tec
Browse files
Make the !source command output more saucy
parent
9a1cbcb1
Pipeline
#238
failed with stages
in 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main.rs
View file @
379f0f2c
...
@@ -61,7 +61,8 @@ impl EventHandler for Handler {
...
@@ -61,7 +61,8 @@ impl EventHandler for Handler {
fn
message
(
&
self
,
ctx
:
Context
,
msg
:
Message
)
{
fn
message
(
&
self
,
ctx
:
Context
,
msg
:
Message
)
{
if
!
(
msg
.content
.starts_with
(
&
CONFIG
.command_prefix
))
{
if
!
(
msg
.content
.starts_with
(
&
CONFIG
.command_prefix
))
{
if
msg
.content
.contains
(
&
format!
(
"<@!{}>"
,
CONFIG
.bot_id
))
// desktop mentions
if
msg
.content
.contains
(
&
format!
(
"<@!{}>"
,
CONFIG
.bot_id
))
// desktop mentions
||
msg
.content
.contains
(
&
format!
(
"<@{}>"
,
CONFIG
.bot_id
))
// mobile mentions
||
msg
.content
.contains
(
&
format!
(
"<@{}>"
,
CONFIG
.bot_id
))
// mobile mentions
{
{
send_message!
(
send_message!
(
msg
.channel_id
,
msg
.channel_id
,
...
@@ -91,11 +92,13 @@ impl EventHandler for Handler {
...
@@ -91,11 +92,13 @@ impl EventHandler for Handler {
"poll"
=>
voting
::
Commands
::
poll
(
ctx
,
msg
.clone
(),
content
),
"poll"
=>
voting
::
Commands
::
poll
(
ctx
,
msg
.clone
(),
content
),
"cowsay"
=>
voting
::
Commands
::
cowsay
(
ctx
,
msg
.clone
(),
content
),
"cowsay"
=>
voting
::
Commands
::
cowsay
(
ctx
,
msg
.clone
(),
content
),
"source"
=>
{
"source"
=>
{
send_message!
(
let
mut
mesg
=
MessageBuilder
::
new
();
msg
.channel_id
,
mesg
.push
(
&
ctx
.http
,
"You want to look at my insides!? Eurgh.
\n
Just kidding, you can go over "
,
"You want to look at my insides!? Eurgh.
\n
Just kidding, you can go over every inch of me here: https://gitlab.ucc.asn.au/UCC/discord-bot"
);
);
mesg
.push_italic
(
"every inch "
);
mesg
.push
(
"of me here: https://gitlab.ucc.asn.au/UCC/discord-bot 😉"
);
send_message!
(
msg
.channel_id
,
&
ctx
.http
,
mesg
.build
());
}
}
"help"
=>
{
"help"
=>
{
// Plaintext version, keep in case IRC users kick up a fuss
// Plaintext version, keep in case IRC users kick up a fuss
...
...
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