|
|
@ -0,0 +1,18 @@ |
|
|
|
from paircd.client import Client |
|
|
|
from paircd.command_handler import CommandHandler |
|
|
|
from paircd.message import Message |
|
|
|
from paircd.reply import RPL_NOWAWAY, RPL_UNAWAY |
|
|
|
from paircd.server import Server |
|
|
|
|
|
|
|
|
|
|
|
class AwayHandler(CommandHandler): |
|
|
|
def __init__(self) -> None: |
|
|
|
super().__init__("AWAY") |
|
|
|
|
|
|
|
async def handle(self, server: Server, client: Client, msg: Message) -> None: |
|
|
|
if len(msg.args) == 0 or len(msg.args[0]) == 0: |
|
|
|
client.away = "" |
|
|
|
client.write_message(RPL_UNAWAY(client.nickname)) |
|
|
|
else: |
|
|
|
client.away = msg.args[0] |
|
|
|
client.write_message(RPL_NOWAWAY(client.nickname)) |