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 6000063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:38:24+00:00 2026-05-23T00:38:24+00:00

[EDIT] Sorry about the title being off. I was thinking of a different problem

  • 0

[EDIT] Sorry about the title being off. I was thinking of a different problem I was having, and accidentally crossed the two.

Hi everyone, I’m writing my IRC bot skeleton in Python currently.

To explain a couple things before I ask my question, I am writing a IRC bot complete with a plug-in system that will receive signals (i.e. when a message is received, a person was seen joining a channel, …), and to call these functions contained in the plug-in, I will be using a helper method, i.e. if we saw a message, call sawMessage. sawMessage will locate which plug-ins want to handle messages, using a PluginManager class, etc. I have the whole system thought out.

I also have a function for each IRC action, i.e. “doJoin”, “doPart”, etc. so that plug-ins can call these without me exposing my socket connection to the plug-ins directly. — Should these functions automatically call the appropriate sawMessage, sawJoin, etc. ? Or should it be up to the plug-in to call sawMessage after calling doMessage? The reason I am asking is because if doMessage calls sawMessage, and sawMessage processes something that calls doMessage, it can end up recursing a lot before unwinding the stack.

The drawbacks of making the plug-in responsible for calling sawMessage to notify the other plug-ins is that the plug-in would have a choice of NOT notifying the other plug-ins, and also that if the plug-in DOES call the sawMessage function, the recursion issue could pop right back up.

I’m not sure how to resolve this. It seems like good practice to make doMessage automatically call sawMessage to notify other plug-ins, but there is always the possibility of a stack overflow due to recursion if the plug-in is not designed properly (i.e. not to respond to it’s own messages), but if the plug-in has to call sawMessage anyway, the same issue is there.

Got any thoughts/opinions on this? I know it’s not a straight-out question/answer, but I can’t decide what to do with this. Ordinarily, if I was just writing a small bot for my own usage, I wouldn’t care about a possible recursion problem. However, I am writing this for the purpose of distribution (I want this to be the next HUGE bot, just like every other IRC bot developer 😀 ) and I want it made properly.

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-23T00:38:25+00:00Added an answer on May 23, 2026 at 12:38 am

    It sounds like you need to decide between or read up more on Publish/subscribe and Chain of Responsibility. Unfortunately I don’t have much experience in this area. Just happened to read a related article recently.

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

Sidebar

Related Questions

at first sorry about my poor English. Now Im having a problem in closing
Edit: When I say SQL Server, I'm really talking about the Management Studio. Sorry
IMPORTANT EDIT: Sorry everyone, i made a big mistake in the structure. char *name;
Edit: I fixed the problem by just starting from scratch. Sorry to waste y'alls
First of all, sorry about the title -- I couldn't figure out one that
I am sorry for possible misleading about the title, but I have no idea
sorry about the title, I'm not sure how to even describe this, which makes
Sorry about the terrible title. I have a signed assembly 'Signed.dll' that is a
Sorry about the title, I couldn't come up with a clean way to ask
I'm sorry about the ambiguous title - I couldn't come up with an explanation

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.