aboutsummaryrefslogtreecommitdiff
path: root/src/Database.py
diff options
context:
space:
mode:
authorGravatar jesopo2020-02-05 16:27:04 +0000
committerGravatar jesopo2020-02-05 16:29:07 +0000
commitc4136a50ecf01f76784f6c96dc4a7f0445b728a1 (patch)
tree4781d4d5b29610f52c233498e8d53c4412d5c2f1 /src/Database.py
parentis8601_format_now() -> iso8601_now() (diff)
signature
refactor -b/-q/-m timer logic in to 1 function
Diffstat (limited to 'src/Database.py')
-rw-r--r--src/Database.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Database.py b/src/Database.py
index 6c79bb1d..f293511c 100644
--- a/src/Database.py
+++ b/src/Database.py
@@ -68,6 +68,11 @@ class Channels(Table):
channels WHERE server_id=? AND name=?""",
[server_id, name.lower()])
return value if value == None else value[0]
+ def by_id(self, channel_id: int):
+ value = self.database.execute_fetchone(
+ "SELECT server_id, name FROM channels WHERE channel_id=?",
+ [channel_id])
+ return value
def rename(self, channel_id: int, new_name: str):
self.database.execute("UPDATE channels SET name=? where channel_id=?",
[new_name.lower(), channel_id])