Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6876321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:27:45+00:00 2026-05-27T04:27:45+00:00

I’m writing an IRC bot in PHP, and I wanted to make a s

  • 0

I’m writing an IRC bot in PHP, and I wanted to make a s little more sophisticated then most other bots.

I have the following classes in my application:

  1. Bot – The actual bot class, it handles all of the functionality and commands the bots can get.
  2. Registry – Global settings and variables, passed on to any functioning class so that I don’t have to litter the global namespace with variables.
  3. Channel – Defines the channel object, properties: $name, $nicklist, where $name is the channel name and $nicklist is an array of User objects.
  4. User – Defines the user object, properties: $nickname, $fullAddress, where $fullAddress is the user’s address in the form of nick!user@host.

So far so good, however, a user may be on multiple channels, and since I don’t want to have multiple objects from the same user (as if a user, for instance, changes his nickname, I’ll have to update multiple elements instead of just one).

How would I go about this, I was thinking about holding a grand user pool at the base of the Bot class, and pass these references to the channels, but I don’t really know how to do that either 😛

Can anyone point me in the right direction? I can paste my current code if you’d like (it’s rather long so I rather not do it if no one needs it).

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:27:46+00:00Added an answer on May 27, 2026 at 4:27 am

    Since the Bot object is the one that needs to do the tracking, have an array of User objects on it, and pass the pointers to those objects (aka $bot->users['name']) to the Channel object.

    That way, the same pointer can be passed twice in case the user is already found on the users list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.