Compare commits
3 Commits
a7fb575a55
...
6368a60f59
Author | SHA1 | Date | |
---|---|---|---|
6368a60f59 | |||
cc148145d3 | |||
d46fe77dca |
2
bot.py
2
bot.py
|
@ -446,6 +446,8 @@ class Fulvia(irc.IRCClient):
|
||||||
line = "-!- {oldname} is now known as {newname}"
|
line = "-!- {oldname} is now known as {newname}"
|
||||||
|
|
||||||
for channel_name, channel in self.channels.items():
|
for channel_name, channel in self.channels.items():
|
||||||
|
if oldname not in channel.users.keys():
|
||||||
|
continue
|
||||||
self.log(channel_name, line)
|
self.log(channel_name, line)
|
||||||
|
|
||||||
user = channel.users.pop(oldname)
|
user = channel.users.pop(oldname)
|
||||||
|
|
|
@ -7,6 +7,7 @@ import datetime
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from module import commands
|
from module import commands
|
||||||
|
import tools.time
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
|
@ -69,3 +70,12 @@ def idleTimeWulf(result, bot):
|
||||||
t = datetime.datetime.fromtimestamp(int(signon))
|
t = datetime.datetime.fromtimestamp(int(signon))
|
||||||
delta = datetime.datetime.now() - t
|
delta = datetime.datetime.now() - t
|
||||||
bot.msg("Adalwulf" + "_"*delta.days)
|
bot.msg("Adalwulf" + "_"*delta.days)
|
||||||
|
|
||||||
|
|
||||||
|
@commands('unix')
|
||||||
|
def unixtolocal(bot, trigger):
|
||||||
|
"""Converts the given timestamp from unix time to local time."""
|
||||||
|
unix = int(trigger.group(2))
|
||||||
|
dt = datetime.datetime.utcfromtimestamp(unix)
|
||||||
|
dt = dt.replace(tzinfo=datetime.timezone.utc)
|
||||||
|
bot.msg(dt.astimezone(tz=None).strftime('%Y-%m-%d %H:%M:%S'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user