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

Improve new user documentation #1629

Open
1 task
vilgotf opened this issue Mar 26, 2022 · 1 comment
Open
1 task

Improve new user documentation #1629

vilgotf opened this issue Mar 26, 2022 · 1 comment
Labels
t-docs A change to the documentation

Comments

@vilgotf
Copy link
Member

vilgotf commented Mar 26, 2022

Development best practices for twilight are currently hard to discover. For example, most bots developed with twilight will have a Context struct like this:

pub struct Context {
    pub cache: InMemoryCache,
    pub cluster: Cluster,
    pub http: Client,
    // etc.
}

Structuring one's code like this brings two major advantages:

  1. Methods on Context need only take &self instead of InMemoryCache, Cluster etc.
  2. You only need one Arc for multi-threading

But only /examples/lavalink-basic-bot implement this scheme, so it's not easily discoverable for new users.

lavalink-basic-bot is also the only example of a fully functional bot, I believe new users would find additional, longer examples useful.

@zeylahellyer zeylahellyer added the t-docs A change to the documentation label Mar 27, 2022
@laralove143
Copy link
Member

twilight's support for the tracing crate goes unnoticed unless people look at examples, most libs mention it, optionally linking to the readme or docs of the crate. i think this used to be the case with twilight, it'd be nice to have it back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-docs A change to the documentation
Projects
None yet
Development

No branches or pull requests

3 participants