Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible fix for #58 v2! #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion qai_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ def on_privmsg(self, *args, **kwargs):

if sender.startswith("NickServ!"):
self.__handleNickservMessage(msg)
return
if not msg.startswith ("!"):
if not sender in self.timers:
self.timers[sender] = 16
if time.time() - self.timers[sender] > 15:
self.bot.privmsg(kwargs['mask'].nick, "This is an official bot run by Forged Alliance Forever. Replies to this bot are not monitored. If you need to talk to a moderator, find someone with their name in white at the top of the player list. If there are none online at this time then ask someone in chat to help you.")
Copy link
Member

@micheljung micheljung Sep 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find someone with their name in white at the top of the player list

This makes assumptions about the user interface, but it may change, the user may have a different style installed, or he may use a different client

self.timers[sender] = time.time()

@command(permission='admin', public=False)
@asyncio.coroutine
Expand Down Expand Up @@ -1015,4 +1022,4 @@ def __dbGet(self, path):
return reply

def __dbSave(self):
self.bot.db.set('misc', lastSaved=time.time())
self.bot.db.set('misc', lastSaved=time.time())