Skip to content

Commit

Permalink
Drop Update #6 (#195)
Browse files Browse the repository at this point in the history
* use auto-complete for drop/clip post queries!

* addin some drops

* bump version

* use inclusion search for autocomplete

Co-authored-by: jp00p <asimovsghost@gmail.com>
  • Loading branch information
zmattingly and jp00p committed Jul 23, 2022
1 parent d0b335a commit a79f727
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 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.0.1
appVersion: v1.0.1
version: v1.0.2
appVersion: v1.0.2
9 changes: 7 additions & 2 deletions commands/clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
clip_data = json.load(f)
f.close()

async def clip_autocomplete(ctx:discord.AutocompleteContext):
clip_keys = clip_data.keys()
return [key for key in clip_keys if ctx.value.lower() in key.lower()]

# Create drop Slash Command Group
clip = bot.create_group("clip", "Clip Commands!")

Expand Down Expand Up @@ -44,8 +48,9 @@ async def clips_list(ctx:discord.ApplicationContext):
)
@option(
name="query",
description="Which clip?",
required=True
description="Which clip? NOTE: Uses autocomplete, start typing and it should show relevant results!",
required=True,
autocomplete=clip_autocomplete
)
@option(
name="private",
Expand Down
8 changes: 7 additions & 1 deletion commands/drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
drop_data = json.load(f)
f.close()

async def drop_autocomplete(ctx:discord.AutocompleteContext):
drop_keys = drop_data.keys()
return [key for key in drop_keys if ctx.value.lower() in key.lower()]
# return drop_data.keys()

# Create drop Slash Command Group
drop = bot.create_group("drop", "Drop Commands!")

Expand Down Expand Up @@ -43,8 +48,9 @@ async def drop_list(ctx:discord.ApplicationContext):
)
@option(
name="query",
description="Which drop?",
description="Which drop? NOTE: Uses autocomplete, start typing and it should show relevant results!",
required=True,
autocomplete=drop_autocomplete
)
@option(
name="private",
Expand Down
35 changes: 30 additions & 5 deletions data/drops.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
"description": "Edward Larkin!",
"url": "https://i.imgur.com/YFWACsb.mp4"
},
"First Contact": {
"file": "data/drops/firstcontact.mp4",
"description": "First Contact",
"url": "https://i.imgur.com/2v5GLsT.mp4"
},
"For Some Reason Jake": {
"file": "data/drops/jakesisko.mp4",
"description": "Jake Sisko. For some reason Jake.",
Expand Down Expand Up @@ -244,6 +249,11 @@
"description": "Schismd Schismed",
"url": "https://i.imgur.com/73kfmOi.mp4"
},
"Shipwide Announcement": {
"file": "data/drops/shipwideannouncement.mp4",
"description": "Shipwide Announcement",
"url": "https://i.imgur.com/wJVjSWw.mp4"
},
"Tasha Yar: I Don't Believe This!": {
"file": "data/drops/tashayaridontbelievethis.mp4",
"description": "Tasha Yar: I Don't Believe This!",
Expand All @@ -259,11 +269,6 @@
"description": "Captain Janeway: There's coffee in that...",
"url": "https://i.imgur.com/858tWqK.mp4"
},
"This Is Fucking Spectacular!": {
"file": "data/drops/thisisfuckingspectacular.mp4",
"description": "I am Chief Miles Edward O'Brien. This is fucking spectacular!",
"url": "https://i.imgur.com/NnBORtU.mp4"
},
"The 359truther Drop": {
"file": "data/drops/the359trutherdrop.mp4",
"description": "The 359truther Drop",
Expand All @@ -274,6 +279,11 @@
"description": "The AGIMUS Drop",
"url": "https://i.imgur.com/ZeKmQNS.mp4"
},
"The astuary Drop!": {
"file": "data/drops/theastuarydrop.mp4",
"description": "The astuary Drop",
"url": "https://i.imgur.com/TveAysC.mp4"
},
"The ayluge Drop": {
"file": "data/drops/theaylugedrop.mp4",
"description": "The ayluge Drop",
Expand Down Expand Up @@ -319,6 +329,11 @@
"description": "The DrZ Dr Z Drop",
"url": "https://i.imgur.com/MXqbvdQ.mp4"
},
"The Dr Z (v2.0) Drop": {
"file": "data/drops/thedrzv2drop.mp4",
"description": "The Dr Z (v2.0) Drop",
"url": "https://i.imgur.com/uyOBghv.mp4"
},
"The Erica Drop": {
"file": "data/drops/theericadrop.mp4",
"description": "The Erica Drop",
Expand Down Expand Up @@ -454,6 +469,16 @@
"description": "The Worf's Calisthenics Drop",
"url": "https://i.imgur.com/0F9xBtW.mp4"
},
"The Wynde Drop": {
"file": "data/drops/thewyndedrop.mp4",
"description": "The Wynde Drop",
"url": "https://i.imgur.com/qjDTN7j.mp4"
},
"This Is Fucking Spectacular!": {
"file": "data/drops/thisisfuckingspectacular.mp4",
"description": "I am Chief Miles Edward O'Brien. This is fucking spectacular!",
"url": "https://i.imgur.com/NnBORtU.mp4"
},
"Timpani Drum": {
"file": "data/drops/timpanidrum.mp4",
"description": "Timpani Drum Sound Effect",
Expand Down

0 comments on commit a79f727

Please sign in to comment.