mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Aka: Add some redundant constraints, just in case.
This commit is contained in:
parent
e9cbb1f60b
commit
b7a9569f72
@ -54,9 +54,10 @@ if sqlalchemy:
|
|||||||
__tablename__ = 'aliases'
|
__tablename__ = 'aliases'
|
||||||
|
|
||||||
id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
|
id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
|
||||||
name = sqlalchemy.Column(sqlalchemy.String)
|
name = sqlalchemy.Column(sqlalchemy.String, unique=True)
|
||||||
alias = sqlalchemy.Column(sqlalchemy.String)
|
alias = sqlalchemy.Column(sqlalchemy.String)
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, name, alias):
|
def __init__(self, name, alias):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.alias = alias
|
self.alias = alias
|
||||||
@ -254,6 +255,8 @@ class Aka(callbacks.Plugin):
|
|||||||
if self.__parent.isCommandMethod(name):
|
if self.__parent.isCommandMethod(name):
|
||||||
raise AliasError(_('You can\'t overwrite commands in '
|
raise AliasError(_('You can\'t overwrite commands in '
|
||||||
'this plugin.'))
|
'this plugin.'))
|
||||||
|
if self._db.has_aka(channel, name):
|
||||||
|
raise AliasError(_('This Aka already exists.'))
|
||||||
biggestDollar = findBiggestDollar(alias)
|
biggestDollar = findBiggestDollar(alias)
|
||||||
biggestAt = findBiggestAt(alias)
|
biggestAt = findBiggestAt(alias)
|
||||||
wildcard = '$*' in alias
|
wildcard = '$*' in alias
|
||||||
|
Loading…
Reference in New Issue
Block a user