Discord Bot merge requestshttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests2020-06-18T23:07:22+08:00https://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/11add expired member support2020-06-18T23:07:22+08:00Ashadd expired member supportmake sure to make an expired member role and add it to the config, defaults to disabled (0)make sure to make an expired member role and add it to the config, defaults to disabled (0)https://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/12Master2020-05-01T15:54:22+08:00grahameMasterescape user-provided string when building LDAP query
check in Cargo.lock (fixes build, upstream breakage in lber)escape user-provided string when building LDAP query
check in Cargo.lock (fixes build, upstream breakage in lber)https://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/10cleanup2020-03-28T15:31:45+08:00Ashcleanupsome cleanupsome cleanuphttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/9move secrets to a separate config2020-03-27T17:12:53+08:00Ashmove secrets to a separate configaaaaaaaaaaaaaaaaaaaahttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/8fixes2020-03-27T15:19:37+08:00Ashfixesvarious fixes and improvementsvarious fixes and improvementshttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/7cleanup macros and reduce code duplication2020-03-25T22:31:08+08:00Ashcleanup macros and reduce code duplicationhttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/6use enumerate() and fix indents2020-03-25T20:21:22+08:00Ashuse enumerate() and fix indentsdont use `let mut i` with unchecked addition, use iteratorsdont use `let mut i` with unchecked addition, use iteratorshttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/5Betternickname2020-03-25T20:20:37+08:00AshBetternicknameuse static array and choose()use static array and choose()https://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/4Better way of doing random nickname2020-03-25T19:02:06+08:00AshBetter way of doing random nicknameuse a static slice of nicknames and choose()use a static slice of nicknames and choose()https://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/3Change some massive indents to use guard!() pattern2020-02-04T21:55:52+08:00AshChange some massive indents to use guard!() patternguard!() is good, massive if coooooooooooooooooooooooooooooooooooooooooooooooooooode else error blocks are notguard!() is good, massive if coooooooooooooooooooooooooooooooooooooooooooooooooooode else error blocks are nothttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/2load discord_token at runtime2020-01-31T18:00:13+08:00squimmyload discord_token at runtime`token` is only needed at startup so it doesn't really need to live with the rest of the config stuff.
Is it considered bad practice to import functions directly rather than importing just the namespace and calling them as, for example,...`token` is only needed at startup so it doesn't really need to live with the rest of the config stuff.
Is it considered bad practice to import functions directly rather than importing just the namespace and calling them as, for example, `std::fs::read_to_string()`????tectechttps://gitlab.ucc.asn.au/UCC/discord-bot/-/merge_requests/1Config file2020-01-30T19:51:38+08:00squimmyConfig fileThis change moves (most of) the config stuff into config files that are loaded at runtime.
It seems to work okay but there are a couple of problems:
- I don't like that the contents of the config file are kept around as a separate stat...This change moves (most of) the config stuff into config files that are loaded at runtime.
It seems to work okay but there are a couple of problems:
- I don't like that the contents of the config file are kept around as a separate static string, but it seems like the deserializer expects a string with equivalent lifetime to the value it deserializes to. This strikes me as a little odd. Is there some sort of workaround to this? I glanced over the toml source and it looks like all the deserialization methods have the same lifetime parameters.
- `discord_token` is still being loaded at compile time, which sucks. In theory we should be able to load it as a static just like `CONFIG_FILE`, but I get a confusing type-error when I try that, so maybe someone who knows more about rust can help me out there.tectec