Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

[BUG] Bot sends MOTD everytime bot restarts #75

Closed
F0xin1 opened this issue Feb 12, 2017 · 7 comments
Closed

[BUG] Bot sends MOTD everytime bot restarts #75

F0xin1 opened this issue Feb 12, 2017 · 7 comments
Assignees
Labels
reason: Bug Issues that are caused by a deviancy in GAB's behavior reason: V4.0 Source Issues that are caused by AwesomeBot source code
Milestone

Comments

@F0xin1
Copy link
Contributor

F0xin1 commented Feb 12, 2017

Hi, this seems like a pretty natural bug, but it can be very annoying if the bot often crashes and auto restarts

What occurs is while the bot does send the MOTD every X amount of time, however if the bot stops/crashes, and is auto restarted, for instance with PM2, it will send the MOTD again, probably also resetting the timer.

Such as in this picture The first one is when I first added the MOTD. normal
The second was when I restarted the bot, not normal :P

@HilbertGilbertson HilbertGilbertson added the reason: Bug Issues that are caused by a deviancy in GAB's behavior label Feb 12, 2017
@Gilbert142 Gilbert142 added the reason: V4.0 Source Issues that are caused by AwesomeBot source code label Feb 12, 2017
@Gilbert142
Copy link
Member

Yep, this is defo a problem.
This also includes timer extensions, because the bot's code sets the MOTD/timer setTimeout() function on startup.

While this is annoying, it's most likely better to prevent crashes from the bot all together. Besides, possibly a save shutdown command? Where the bot dumps it's session data (such as timer-times) in a temp file, and reads that file upon boot.

@HilbertGilbertson
Copy link
Collaborator

possibly a save shutdown command? Where the bot dumps it's session data (such as timer-times) in a temp file, and reads that file upon boot.

Sounds like a a good idea. Should it be a file or stored in the DB? remembers the days of ABv3 and oversized JSON files

@Gilbert142
Copy link
Member

I was thinking about a /tmp/ dir

@HilbertGilbertson
Copy link
Collaborator

I see. Containing json files? e.g. tmp/timers.json etc? Nice.

@vladfrangu
Copy link
Member

Orr use the same way as giveaways, where the setTimeout does the MOTD after x time, saving the time in the db?

@Gilbert142 Gilbert142 mentioned this issue Mar 20, 2017
13 tasks
@vladfrangu vladfrangu added this to the v4.1.0 milestone Mar 21, 2017
@0sean
Copy link

0sean commented Apr 6, 2017

Something could be stored in the DB, maybe on shutdown set it to a certain value that the bot reads while starting up, telling it whether to say the MOTD

@Gilbert142
Copy link
Member

Fixed in #184

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
reason: Bug Issues that are caused by a deviancy in GAB's behavior reason: V4.0 Source Issues that are caused by AwesomeBot source code
Projects
None yet
Development

No branches or pull requests

5 participants