mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 13:12:35 +01:00
supybot.reply.format.databaseRecord: Add $nick
This commit is contained in:
parent
4046a1b201
commit
7444e656d8
@ -444,10 +444,13 @@ class ChannelIdDatabasePlugin(callbacks.Plugin):
|
|||||||
|
|
||||||
def showRecord(self, record):
|
def showRecord(self, record):
|
||||||
template = string.Template(conf.supybot.reply.format.databaseRecord())
|
template = string.Template(conf.supybot.reply.format.databaseRecord())
|
||||||
|
username = getUserName(record.by)
|
||||||
|
nick = username.split('!')[0] # nick==username iff this is a registered user
|
||||||
return template.substitute(
|
return template.substitute(
|
||||||
id=record.id,
|
id=record.id,
|
||||||
text=record.text,
|
text=record.text,
|
||||||
username=getUserName(record.by),
|
username=username,
|
||||||
|
nick=nick,
|
||||||
at=record.at,
|
at=record.at,
|
||||||
**self.typeSubstitutions(),
|
**self.typeSubstitutions(),
|
||||||
)
|
)
|
||||||
|
@ -509,7 +509,7 @@ registerChannelValue(supybot.reply.format, 'databaseRecord',
|
|||||||
_("""Format used by generic database plugins (Lart, Dunno, Prase, Success,
|
_("""Format used by generic database plugins (Lart, Dunno, Prase, Success,
|
||||||
Quote, ...) to show an entry. You can use the following variables:
|
Quote, ...) to show an entry. You can use the following variables:
|
||||||
$type/$types/$Type/$Types (plugin name and variants), $id, $text,
|
$type/$types/$Type/$Types (plugin name and variants), $id, $text,
|
||||||
$userid/$username (author), $at (creation time).""")))
|
$at (creation time), $userid/$username/$nick (author).""")))
|
||||||
|
|
||||||
registerGlobalValue(supybot.reply, 'maximumLength',
|
registerGlobalValue(supybot.reply, 'maximumLength',
|
||||||
registry.Integer(512*256, _("""Determines the absolute maximum length of
|
registry.Integer(512*256, _("""Determines the absolute maximum length of
|
||||||
|
Loading…
Reference in New Issue
Block a user