Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_role caches role twice #177

Open
Fjorge0 opened this issue Aug 27, 2022 · 2 comments
Open

create_role caches role twice #177

Fjorge0 opened this issue Aug 27, 2022 · 2 comments

Comments

@Fjorge0
Copy link

Fjorge0 commented Aug 27, 2022

Summary

image
(The server with ID 750779254492627078 is the same server I ran the command on)

As the image shows, when using server.create_role to make a new role on a server, the role appears twice on the list returned by server.roles. The two roles are the same and have the same ID.

The duplicate goes away after using bot.init_cache.

There are no exceptions.


Environment

Ruby version:
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]

Discordrb version:
discordrb (3.4.2 e384e4a)

@Fjorge0
Copy link
Author

Fjorge0 commented Aug 27, 2022

I believe this might be caused by

@roles << role

I put the wrong link in earlier

@Fjorge0
Copy link
Author

Fjorge0 commented Oct 1, 2022

I've tested with https://github.com/arch-community/qbot and a local clone of discordrb and removing the line I mentioned above fixes the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant