Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfeature: per chat settings in database #694
Comments
|
There was a discussion about this here: #441 Feel free to suggest a PR for this Would be cool to have various types of settings, possibly also bot-wide ones, to allow custom changes to admin IDs etc. |
|
And then having two or more arguments to consider (command, chat, user) comes the headache of what has priority over what. |
|
@sharkydog I've added a very simple option saving mechanism in the support bot here: I want to add this to core and was wondering if you have any ideas on how best to implement this so that it could allow per-chat settings. |
|
Or Yet Another Maybe - to avoid having multiple key columns and arguments to the functions: |
|
maybe also offer options only through func_get_args() so you do not expose the underlying format, like: function optionGet() {
$args = func_get_args(); // sql clean/escape this
$where = [];
while(!empty($args)) {
$where[] = "`option`='".implode('.',$args)."'";
array_pop($args);
}
$sql = "SELECT `val` FROM `options`";
$sql .= " WHERE ".implode(" OR ",$where);
$sql .= " ORDER BY `option` DESC LIMIT 1";
// execute and return only column or null
} |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Currently, to avoid using another database or flat files I am doing this:
Will be nice to have something in core to be used like this: