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

Add alternative method for initializing a client with some settings #100

Open
2 tasks
lcsmuller opened this issue Sep 17, 2022 · 0 comments
Open
2 tasks
Assignees
Labels
enhancement New feature or request

Comments

@lcsmuller
Copy link
Collaborator

lcsmuller commented Sep 17, 2022

Describe the feature

Add an alternative method for initializing a client with some settings (such as logging), without requiring the config.json file. This would add greater flexibility to the user, as they might use their own custom logic for parsing of their configuration fields.

Possible implementation:

struct discord_settings settings = {
  .token = BOT_TOKEN,
  .prefix = "!",
  .logging = {
    .level = DISCORD_LOG_LEVEL_TRACE,
    .filename = "bot.log",
    .quiet = false,
    .http = "http.log",
  },
};
struct discord *client = discord_settings_init(&settings);

Acceptance criteria

  • Allows all options currently available at config.json
  • Modify discord_config_init() to be calling this new method underneath

Version

v2.1.0

@lcsmuller lcsmuller added the enhancement New feature or request label Sep 17, 2022
@tarbomb tarbomb self-assigned this Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants