User Control Panel
|
|
|
 |
Advertisements
|
 |
|
|
|
HELP US, HELP YOU!
|
| Author |
Message |
jordanovjarra Member

Joined: 07 Nov 2003 Posts: 140
   
|
Posted: Tue Dec 30, 2003 9:26 pm Post subject: |
|
|
Hey when *lazy* join a chat with my bot i use this,
| Code: | | sub Join {<br /> my ($self,$user,$friendly) = @_;<br /> $self->sendmsg("Welcome $user");<br />}<br /> |
But, theres a problem because when the user has a space in there name it shows up as %20 and was wondering how i can filter this out ? |
|
| Back to top |
|
 |
Keenie Almost An Agent

Joined: 31 Oct 2003 Posts: 1071
 
|
Posted: Tue Dec 30, 2003 9:49 pm Post subject: |
|
|
| Code: | | sub Join {<br />my ($self,$user,$friendly) = @_;<br />use URI::Escape;<br />$user = uri_unescape($user);<br />$self->sendmsg("Welcome $user");<br />} |
i usually put the use statements at the top of the file with the rest but it is ok there you could also use
| Code: | | $user =~ s/%20/ /ig; |
but since names are escaped like that might as well unescape them |
|
| Back to top |
|
 |
jordanovjarra Member

Joined: 07 Nov 2003 Posts: 140
   
|
Posted: Tue Dec 30, 2003 10:00 pm Post subject: |
|
|
thanks keenie, my bots startin to take shape now  |
|
| Back to top |
|
 |
Sypher Senior Member

Joined: 01 Jan 2004 Posts: 233 Location: The Netherlands
    
|
Posted: Thu Jan 01, 2004 3:40 pm Post subject: |
|
|
The code is straaaange (in the first post)
I put it in my bot.pl and only I, the owner, get that message and *lazy* else does...
Strange? _________________ Sypher
Developer of Codera |
|
| Back to top |
|
 |
|
|