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
736a0e88
Commit
736a0e88
authored
Mar 25, 2020
by
Ash
Committed by
tec
Mar 25, 2020
Browse files
use enumerate() and fix indents
parent
310851d7
Changes
3
Show whitespace changes
Inline
Side-by-side
src/reaction_roles.rs
View file @
736a0e88
...
...
@@ -101,9 +101,7 @@ pub fn sync_all_role_reactions(ctx: &Context) {
let
mut
roles_to_remove
:
HashMap
<
UserId
,
Vec
<
RoleId
>>
=
HashMap
::
from_iter
(
all_members
.iter
()
.map
(|
m
|
(
m
.user_id
(),
Vec
::
new
())));
let
mut
i
=
0
;
for
(
message
,
mapping
)
in
messages_with_role_mappings
{
i
+=
1
;
for
(
i
,
(
message
,
mapping
))
in
messages_with_role_mappings
.iter
()
.enumerate
()
{
info!
(
" Sync: prossessing message #{}"
,
i
);
for
react
in
&
message
.reactions
{
let
react_as_string
=
get_string_from_react
(
&
react
.reaction_type
);
...
...
@@ -120,7 +118,7 @@ pub fn sync_all_role_reactions(ctx: &Context) {
warn!
(
" need to implement react removal"
);
}
}
for
(
react
,
role
)
in
mapping
{
for
(
react
,
role
)
in
*
mapping
{
info!
(
" message #{}: processing react '{}'"
,
i
,
react
);
// TODO: proper pagination for the unlikely scenario that there are more than 100 (255?) reactions?
let
reaction_type
=
get_react_from_string
(
react
.clone
(),
guild
.clone
());
...
...
src/user_management.rs
View file @
736a0e88
src/voting.rs
View file @
736a0e88
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