HangoutsBot icon indicating copy to clipboard operation
HangoutsBot copied to clipboard

Start commands at defined time

Open sgrunt91 opened this issue 9 years ago • 4 comments

Hello,

I'm not a developper, i don't know many things of Python, and I don't understand 80% of your Bot :-)

But, I want to use your project to made a Bot for fun, and I've added some new commands and also the send image functionnality. So, I'm not also a big noob and I'm learning quite fast.

I just want to know if it's possible to execute a command defined in ExtraCommands.py at a defined time, for example everyday at 9am ? And if it's possible, what is the best practice to do that with your code?

Hope you understand me and could help me :)

Best Regards !

sgrunt91 avatar Apr 11 '15 15:04 sgrunt91

@sgrunt91 Hmm. Currently, I don't have the means for a time-based command like that, but I think it would be possible to add in a feature like that. Let me see what I can do for you.

wardellbagby avatar Apr 13 '15 12:04 wardellbagby

I would also like to have something similar...In the game Ingress, there are defined checkpoints that happen every 5 hours. I would like to be able to call out these checkpoints when they occur, and also to have a optional countdown mode where I could set 60,30,15,10,5,4,3,2,1 minutes-to-checkpoint warnings. I looked at doing this through the existing /remind structure, but haven't gotten very far with it.

cntrlwiz avatar Apr 13 '15 13:04 cntrlwiz

Thanks for the replies !

For now, I've just added a thread in Bot.py which is an infinite loop and check the time and if it's my time do what I want. And I run it in the run(), and it's work. But it's probably very ugly for real developers... And also, I don't understand how to call bot's commands from my thread, so I don't know if I will keep that...

If you have already basic ideas to make that and no time, I could try to develop it, and you could accept or reject the code. I mean that I'm not necessary asking you to make it, just pointing me the right way to do it ;)

Thanks again !

sgrunt91 avatar Apr 18 '15 07:04 sgrunt91

@cntrlwiz be sure to check out the checkpoint.py plugin for nylonee/hangupsbot.

Also, if you're Resistance, hit me up on hangouts please :P

nylonee avatar Apr 18 '15 08:04 nylonee