Skip to content

Commit 09ab5a5

Browse files
committed
Use Channel#part
1 parent db98618 commit 09ab5a5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/fr/ribesg/blob/command/bot/PartCommand.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import fr.ribesg.alix.api.Server;
1010
import fr.ribesg.alix.api.Source;
1111
import fr.ribesg.alix.api.bot.command.Command;
12-
import fr.ribesg.alix.api.bot.command.CommandManager;
13-
import fr.ribesg.alix.api.message.PartIrcPacket;
1412

1513
public class PartCommand extends Command {
1614

@@ -25,7 +23,7 @@ public PartCommand() {
2523
public boolean exec(final Server server, final Channel channel, final Source user, final String primaryArgument, final String[] args) {
2624
if (args.length == 0) {
2725
channel.sendMessage("Bye!");
28-
server.send(new PartIrcPacket(channel.getName()));
26+
channel.part();
2927
} else {
3028
boolean silent = false;
3129
for (final String arg : args) {
@@ -44,7 +42,7 @@ public boolean exec(final Server server, final Channel channel, final Source use
4442
if (!silent) {
4543
otherChannel.sendMessage(user.getName() + " told me I should leave this channel, bye!");
4644
}
47-
server.send(new PartIrcPacket(otherChannel.getName()));
45+
otherChannel.part();
4846
}
4947
}
5048
}

0 commit comments

Comments
 (0)