From 8b3f26a41209cdffbb6a0113fc47c3cb9f314848 Mon Sep 17 00:00:00 2001 From: Raghavan C Date: Sun, 30 Apr 2017 15:31:33 -0400 Subject: [PATCH] added license, 'add' now replaces previous commands --- UNLICENSE | 24 ++++++++++++++++++++++++ cogs/general.py | 5 ++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 UNLICENSE diff --git a/UNLICENSE b/UNLICENSE new file mode 100644 index 0000000..6bb8a29 --- /dev/null +++ b/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to \ No newline at end of file diff --git a/cogs/general.py b/cogs/general.py index 07ad09d..4b82064 100644 --- a/cogs/general.py +++ b/cogs/general.py @@ -40,7 +40,10 @@ async def _add_command(self, cmd_type, cmd_trigger, *, cmd: str): is_tts = False cur = self.conn.cursor() cur.execute( - "INSERT INTO message_commands (invoke, message, istts, idk) VALUES (%s, %s, %s, %s) ON CONFLICT DO NOTHING", + "INSERT INTO message_commands (invoke, message, istts, idk)" + " VALUES (%s, %s, %s, %s) " + "ON CONFLICT (invoke) " + "DO UPDATE SET message = EXCLUDED.message", [cmd_trigger, cmd, is_tts, True]) self.conn.commit() cur.close()