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
9b5ec5aa
Unverified
Commit
9b5ec5aa
authored
Oct 20, 2019
by
tec
Browse files
Ignore bot reactions, but care about bot messages
parent
f991ed61
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main.rs
View file @
9b5ec5aa
...
...
@@ -89,7 +89,7 @@ impl EventHandler for Handler {
fn
reaction_add
(
&
self
,
ctx
:
Context
,
add_reaction
:
channel
::
Reaction
)
{
match
add_reaction
.message
(
&
ctx
.http
)
{
Ok
(
message
)
=>
{
if
message
.author.id
.0
==
config
::
BOT_ID
{
if
message
.author.id
.0
!=
config
::
BOT_ID
||
add_reaction
.user_id
==
config
::
BOT_ID
{
return
;
}
match
message_type
(
&
message
)
{
...
...
@@ -106,7 +106,7 @@ impl EventHandler for Handler {
fn
reaction_remove
(
&
self
,
ctx
:
Context
,
removed_reaction
:
channel
::
Reaction
)
{
match
removed_reaction
.message
(
&
ctx
.http
)
{
Ok
(
message
)
=>
{
if
message
.author.id
.0
==
config
::
BOT_ID
{
if
message
.author.id
.0
!=
config
::
BOT_ID
||
removed_reaction
.user_id
==
config
::
BOT_ID
{
return
;
}
match
message_type
(
&
message
)
{
...
...
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