]> jfr.im git - z_archive/kelsier.git/blob - Command.cs
82abeedf6f8acf528af66c865b7909949840bb2d
[z_archive/kelsier.git] / Command.cs
1 // Kelsier project - Command info code (Command.cs)
2 // Written by the Jobbig codeteam. <http://jobbig.eu/code/>
3 //
4 // Copyright 2013 John Runyon.
5 //
6 // This file is part of the Kelsier project.
7 //
8 // Kelsier is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
17 //
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 //
21
22 using System;
23 namespace Kelsier {
24 public class Command {
25 public string cmd { get; private set; }
26 public string[] args { get; private set; }
27 public User user { get; private set; }
28 public Channel chan { get; private set; }
29 public bool chanmsg { get; private set; }
30 public string replyTo { get; private set; }
31
32 public Command(string cmd, string[] args, User user, Channel chan, bool chanmsg) {
33 this.cmd = cmd;
34 this.args = args;
35 this.user = user;
36 this.chan = chan;
37 this.chanmsg = chanmsg;
38 if (chanmsg)
39 this.replyTo = chan.name;
40 else
41 this.replyTo = user.nick;
42
43 Root.log.debug(String.Format("cmd={0},args={1},user={2},chan={3},chanmsg={4},replyTo={5}", cmd, args.Length, user.nick, chan.name, chanmsg, replyTo));
44 }
45 }
46 }
47