-
Notifications
You must be signed in to change notification settings - Fork 105
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
Get songbird instance from external api call #197
Comments
It should be possible to store the lazy_static!{
static ref SONG: OnceCell<Arc<Songbird>> = OnceCell::new();
} I use a If you are using serenity, and want to know how to set this after initializing the client, its as follows: let sb = client.data.read().await
.get::<SongbirdKey>()
.expect("Failed to get or initialize Songbird")
.clone();
SONG.set(sb).expect("Error setting Songbird (SONG)"); Then, to use it anywhere in your code, all you need to do is: let sb = SONG.get().expect("Songbird not found!").clone(); |
I want to play sounds from an external API call (Soundboard)
But I can't get the songbird instance
I tried storing it in a lazy_static but since it doesn't implement the Send trait I cant?
The bot is only on one server, so any hack/workaround is working for me
Any luck or is it not possible?
The text was updated successfully, but these errors were encountered: