im trying to make a !chat room, i have edited the code, but it seems to say !chat not a command, but it is, where am i sopposed to put it in this code:
Code:
sub chat<br />{<br /> my ($bot, $self, $user, $msg) = @_;<br /><br /> my $user_settings = $bot->{users}->{$user};<br /> my $msn = $bot->{msn};<br /> my $settings = $bot->{settings};<br /><br /> # command body here.<br /><br />if ($bot->{users}->{$user}->{chatban} eq 'banned')<br />{return"sorry you are banned from chat....please type $bot->{settings}->{CommandChar}gettrev if you think this is wrong"}<br />elsif ($bot->{settings}->{chatlock} eq 'locked')<br />{return"the chat has been locked......please try again later:("}<br /> elsif ($msg eq '')<br /> {<br /> $user_settings->{callback} = "chat";<br /> return " ...:: 3Dwights 7Chat 12Room ::..<br />13Rules:<br />2*NO inviting other bots<br />*NO inviting troublesome users<br />*NO spamming/flooding<br />*NO swearing<br />*NO racism<br />*NO playing games in the chatroom<br />4if you agree please type (173,173,209)!chat ok 1Thanks";<br /> } <br /> elsif ($msg eq 'ok')<br /> { <br /> $user_settings->{callback} = "";<br /> if (!exists $bot->{chatroom} or !exists $bot->{msn}->{Socks}->{$bot->{chatroom}->{fn}} ) {<br /> $bot->{chatroom} = $self;<br /> $self->{settings}->{Silent} = 1;<br /><br /> return "3There is 4NO 7chat, im going to create a chat using this conversation<br /><br /><br /> 6Dwight Bot, just made this the chat!!!!";<br /> }<br /> elsif ($self eq $bot->{chatroom})<br /> {<br /> return "12well you big fat 5RETARD 2<br /> ..:: This is Chat ::.. :D :D :D :)";<br /> }<br /> else<br /> {<br /> $bot->{chatroom}->invite($user);<br /> return "10Thank you for agreeing to the rules !!! Please wait while i invite you to the chat, if you are not invited please type !getdwight !!<br /><br /> 13thanks!";<br /> }<br /> }<br /> else<br /> {<br /> $user_settings->{callback} = "";<br /> return "4If You Dont Agree To The Rules Then Go Away,Other Wise Type ok1";<br /> }<br /> <br />}<br /><br />{<br /> Category => '(8)CHAT(8)', <br /> Description => 'start a chat room',<br />};
EX. if i type !chat and theres no chat, then how can i get it to popup a message saying NEW CHAT CREATED!! Type !chat to access it!!!