Add Database.channels.rename, as part of support for IRCv3's RENAME

This commit is contained in:
jesopo 2018-11-05 16:46:24 +00:00
parent 7c3a8e7444
commit 055390e220

View file

@ -40,6 +40,9 @@ class Channels(Table):
channels WHERE server_id=? AND name=?""", channels WHERE server_id=? AND name=?""",
[server_id, name.lower()]) [server_id, name.lower()])
return value if value == None else value[0] return value if value == None else value[0]
def rename_channel(self, channel_id: int, new_name: str):
self.database.execute("UPDATE channels SET name=? where channel_id=?",
[new_name.lower(), channel_id])
class Users(Table): class Users(Table):
def add(self, server_id: int, nickname: str): def add(self, server_id: int, nickname: str):