I always forget about scopes in for loops

This commit is contained in:
jesopo 2018-10-07 08:10:52 +01:00
parent 29d8549da1
commit dc37eb4f2f

View file

@ -39,7 +39,8 @@ class Module(ModuleManager.BaseModule):
for server_id, channel_name, _ in hooks:
server = self.bot.get_server(server_id)
channel = server.get_channel(channel_name)
self.bot.trigger(self._make_trigger(channel, server, line))
self.bot.trigger(lambda: self.events.on("send.stdout"
).call(target=channel, module_name="Github",
server=server, message=line))
def _make_trigger(self, channel, server, line):
return lambda: self.events.on("send.stdout").call(
target=channel, module_name="Github", server=server, message=line)