Skip to content

Commit

Permalink
more shit
Browse files Browse the repository at this point in the history
  • Loading branch information
omame committed Jun 11, 2021
1 parent 59cf19a commit 471371d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bob/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "2.2.3 beta"
__version__ = "2.2.4 beta"
blue_color = 0x2273E6
red_color = 0xE82E3E
10 changes: 10 additions & 0 deletions cogs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ async def periodic_data_clean_and_save(self):
while len(self.question_map.values()) > self.config["question_limit"]:
self.question_map.pop(list(self.question_map.keys())[0])
removed += 1
to_pop = []
for question_key in self.question_map.keys():
question = self.question_map[question_key]
if question.author in self.config["blacklist"]:
to_pop.append(question_key)

for key in to_pop:
self.question_map.pop(key)

removed += len(to_pop)
self.logger.debug("removed %d questions, saving data...", removed)
self.save_data()

Expand Down
3 changes: 3 additions & 0 deletions cogs/lar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ async def learn(self, message: discord.Message):
except discord.NotFound:
return

if reply.author.id not in self.config.config["optin"]:
return

content = qna.classes.sanitize_question(reply.clean_content) + " " + \
" ".join([attachment.url for attachment in reply.attachments])
if content not in self.config.question_map.keys():
Expand Down

0 comments on commit 471371d

Please sign in to comment.