quote grab category shouldn't be a server/channel object. wtf
This commit is contained in:
parent
83f0eacb1c
commit
6ce20e3562
1 changed files with 5 additions and 7 deletions
|
@ -126,28 +126,26 @@ class Module(ModuleManager.BaseModule):
|
||||||
raise utils.EventError(
|
raise utils.EventError(
|
||||||
"Please provide a number between 1 and 3")
|
"Please provide a number between 1 and 3")
|
||||||
|
|
||||||
target = event["args_split"][0]
|
target_user = event["args_split"][0]
|
||||||
lines = event["target"].buffer.find_many_from(target, line_count)
|
lines = event["target"].buffer.find_many_from(target_user, line_count)
|
||||||
if lines:
|
if lines:
|
||||||
lines.reverse()
|
lines.reverse()
|
||||||
target = event["server"]
|
target = event["server"]
|
||||||
if event["target"].get_setting("channel-quotes", False):
|
if event["target"].get_setting("channel-quotes", False):
|
||||||
target = event["target"]
|
target = event["target"]
|
||||||
|
|
||||||
quotes = self._get_quotes(target, target)
|
|
||||||
|
|
||||||
lines_str = []
|
lines_str = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
lines_str.append(line.format())
|
lines_str.append(line.format())
|
||||||
text = " ".join(lines_str)
|
text = " ".join(lines_str)
|
||||||
|
|
||||||
quotes.append([event["user"].name, int(time.time()), text])
|
|
||||||
|
|
||||||
quote_category = line.sender
|
quote_category = line.sender
|
||||||
if event["server"].has_user(quote_category):
|
if event["server"].has_user(quote_category):
|
||||||
account = event["server"].get_user_nickname(
|
quote_category = event["server"].get_user_nickname(
|
||||||
event["server"].get_user(quote_category).get_id())
|
event["server"].get_user(quote_category).get_id())
|
||||||
|
|
||||||
|
quotes = self._get_quotes(target, quote_category)
|
||||||
|
quotes.append([event["user"].name, int(time.time()), text])
|
||||||
self._set_quotes(target, quote_category, quotes)
|
self._set_quotes(target, quote_category, quotes)
|
||||||
|
|
||||||
event["stdout"].write("Quote added")
|
event["stdout"].write("Quote added")
|
||||||
|
|
Loading…
Reference in a new issue