Skip to content

Commit

Permalink
This is just a bunch of small things. (#461)
Browse files Browse the repository at this point in the history
* This is just a bunch of small things.
* Changed "counselor-trois-office" to "counselor-trois-waiting-room" in the configs
* Cleaned up the messages so that words with punctuation aren't considered different
* Added two postcast episodes for VOY

* Additional place where `trois-office` is used

---------

Co-authored-by: Peter of the Norse <[email protected]>
  • Loading branch information
rahmcoff and Peter of the Norse authored Jan 2, 2024
1 parent 4455ee9 commit fcd15f6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
4 changes: 2 additions & 2 deletions charts/agimus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: agimus
description: A helm chart for a discord bot that also runs a mysql db
type: application
version: v1.29.14
appVersion: v1.29.14
version: v1.30.0
appVersion: v1.30.0
2 changes: 1 addition & 1 deletion cogs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ async def _get_wordcloud_embed_and_thumbnail(self):
wordcloud_blocked_channel_ids = get_channel_ids_list([
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"heuristic-associative-pathways",
"megalomaniacal-computer-storage",
"bot-setup",
Expand Down
14 changes: 7 additions & 7 deletions configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"blocked_channels": [
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"heuristic-associative-pathways",
"lieutenants-lounge",
"mclaughlin-group",
Expand All @@ -54,7 +54,7 @@
"blocked_channels": [
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"peoples-resistance-front-of-bajor",
"heuristic-associative-pathways",
"behind-the-visor",
Expand Down Expand Up @@ -125,7 +125,7 @@
"blocked_channels": [
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"heuristic-associative-pathways",
"mo-pips-mo-problemz",
"code-47",
Expand Down Expand Up @@ -391,7 +391,7 @@
"blocked_channels": [
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"peoples-resistance-front-of-bajor",
"heuristic-associative-pathways",
"behind-the-visor",
Expand Down Expand Up @@ -423,7 +423,7 @@
"blocked_channels": [
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"peoples-resistance-front-of-bajor",
"heuristic-associative-pathways",
"behind-the-visor",
Expand Down Expand Up @@ -455,7 +455,7 @@
"blocked_channels": [
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"peoples-resistance-front-of-bajor",
"heuristic-associative-pathways",
"behind-the-visor",
Expand Down Expand Up @@ -555,7 +555,7 @@
"blocked_channels": [
"neelixs-morale-office",
"plasma-vent",
"counselor-trois-office",
"counselor-trois-waiting-room",
"peoples-resistance-front-of-bajor",
"heuristic-associative-pathways",
"behind-the-visor",
Expand Down
20 changes: 18 additions & 2 deletions data/episodes/voy.json
Original file line number Diff line number Diff line change
Expand Up @@ -3425,7 +3425,15 @@
"episode": "04",
"imdb": "tt0708959",
"memoryalpha": "Repression_(episode)",
"podcasts": [],
"podcasts": [
{
"airdate": "2023.12.11",
"episode": "Not Bathtub Serious",
"link": "https://maximumfun.org/episodes/greatest-generation/ep-500-not-bathtub-serious-voy-s7e4/",
"order": 500,
"title": "The Greatest Generation"
}
],
"season": "07",
"stills": [
"https://image.tmdb.org/t/p/original/tKwHas7rA8nObFqxru10VkxBLu2.jpg",
Expand All @@ -3445,7 +3453,15 @@
"episode": "05",
"imdb": "tt0708870",
"memoryalpha": "Critical_Care_(episode)",
"podcasts": [],
"podcasts": [
{
"airdate": "2023.12.18",
"episode": "Tragically Low T",
"link": "https://maximumfun.org/episodes/greatest-generation/ep-501-tragically-low-t-voy-s7e5/",
"order": 501,
"title": "The Greatest Generation"
}
],
"season": "07",
"stills": [
"https://image.tmdb.org/t/p/original/nayxyUBuIQimyvDXRqAeJFzOGcv.jpg",
Expand Down
14 changes: 5 additions & 9 deletions handlers/save_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,19 @@ async def save_message_to_db(message:discord.Message):

# convert message to plaintext
message_content = string_utils.plaintext(message.content)
message_content = string_utils.strip_emoji(message_content)
message_content = string_utils.strip_urls(message_content)
message_content = string_utils.strip_punctuation(message_content)

message_modified = set(message_content.split(" "))

# sort words (obfuscation in db)
message_modified = sorted(list(message_modified))
message_modified = sorted(m.strip() for m in message_modified if m not in string_utils.common_words)

# combine back into string
message_content = " ".join(message_modified)


message_content = string_utils.strip_emoji(message_content)
message_content = string_utils.strip_urls(message_content)
message_content = string_utils.strip_punctuation(message_content)
message_content = message_content.replace(" ", " ") # convert double spaces to single space
message_content = message_content.strip()

if message_content.strip() == "":
if message_content == "":
return None

with AgimusDB() as query:
Expand Down

0 comments on commit fcd15f6

Please sign in to comment.