Coder Social home page Coder Social logo

Implement ?restart about triviabot HOT 3 CLOSED

rawsonj avatar rawsonj commented on August 12, 2024
Implement ?restart

from triviabot.

Comments (3)

rawsonj avatar rawsonj commented on August 12, 2024

Oh, I remember what this is about.

It's a convenience function because when trivia's base code updates, it won't update the running program until it gets killed and restarted, so I wanted to just ?restart and cause it to die and such.

Considering the relative difficulty in implementing this, and likely the stdout, stderr and stdin file descriptor hoo-ha involved in trying to make this work effectively, I'm going to close this as wontfix.

Frankly, it's not that big of a deal to kill the bot and start it again.

from triviabot.

genius3000 avatar genius3000 commented on August 12, 2024

If interested yet, I did get a ?restart working in my fork. It seems to work in my testing at least.
The command sets '_restarting' True, quits and then the 'def connectionLost' handles it:
https://github.com/genius3000/triviabot/blob/483023edf295476ef08c4e3b9206c06fe936d1e5/trivia.py#L557
Ignore the comment above it yet, I must have forgotten to remove it.

I could re-work it to this current master branch and send a PR.

from triviabot.

rawsonj avatar rawsonj commented on August 12, 2024

Hm, ok, reviewing how you did that I think it could actually work. Using execl in an exception handler would replace the current process with the new one, and in this case it would be the updated script.

I'll reopen this. If you want to submit a PR I'll review and merge it. If you're busy, the link you posted is enough to go off of for me to do something similar.

Thanks!

from triviabot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.