Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit ddf3238

Browse files
committed
feat(sign): make 'sign' the official lookup command; fix copy
1 parent c7d6d79 commit ddf3238

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

bot.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def on_ready():
113113
[🧬 **Lifeprint** - Search results]({lifeprint})
114114
[🤝 **SigningSavvy** - Sign for {word_uppercased}]({signingsavvy})
115115
[🌐 **Spread The Sign** - {word_uppercased}]({spread_the_sign})
116-
[📹 **YouGlish** - ASL videos containing {word_uppercased}]({youglish})
116+
[📹 **YouGlish** - Videos containing {word_uppercased}]({youglish})
117117
"""
118118

119119
HOWSIGN_SPOILER_TEMPLATE = """[👋 **Handspeak** - Search results]({handspeak})
@@ -151,7 +151,7 @@ def word_display(word: str, *, has_spoiler: bool):
151151
)
152152

153153

154-
def howsign_impl(word: str):
154+
def sign_impl(word: str):
155155
logger.info(f"sending links for: '{word}'")
156156
spoiler = get_spoiler_text(word)
157157
word = spoiler if spoiler else word
@@ -173,13 +173,13 @@ def howsign_impl(word: str):
173173
return {"embed": embed}
174174

175175

176-
@bot.command(name="howsign", aliases=("sign",), help=HOWSIGN_HELP)
177-
async def howsign_command(ctx: Context, *, word: str):
178-
await ctx.send(**howsign_impl(word))
176+
@bot.command(name="sign", aliases=("howsign",), help=HOWSIGN_HELP)
177+
async def sign_command(ctx: Context, *, word: str):
178+
await ctx.send(**sign_impl(word))
179179

180180

181-
@howsign_command.error
182-
async def howsign_error(ctx, error):
181+
@sign_command.error
182+
async def sign_error(ctx, error):
183183
if isinstance(error, commands.errors.MissingRequiredArgument):
184184
logger.info(f"missing argument to '{ctx.invoked_with}'")
185185
await ctx.send(

tests/__snapshots__/test_bot.ambr

+10-10
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
',
117117
}
118118
---
119-
# name: test_howsign[need, ask]
119+
# name: test_sign[need, ask]
120120
<class 'dict'> {
121121
'embed': <class 'Embed'> {
122122
Empty=Embed.Empty,
@@ -125,8 +125,8 @@
125125
colour=Embed.Empty,
126126
description=Embed.Empty,
127127
fields=<class 'list'> [
128-
EmbedProxy(inline=True, name='NEED', value='[👋 **Handspeak** - Search results](https://www.google.com/search?&q=site%3Ahandspeak.com+need)\n[🧬 **Lifeprint** - Search results](https://www.google.com/search?&q=site%3Alifeprint.com+need)\n[🤝 **SigningSavvy** - Sign for NEED](https://www.signingsavvy.com/search/need)\n[🌐 **Spread The Sign** - NEED](https://www.spreadthesign.com/en.us/search/?q=need)\n[📹 **YouGlish** - ASL videos containing NEED](https://youglish.com/pronounce/need/signlanguage/asl)\n'),
129-
EmbedProxy(inline=True, name='ASK', value='[👋 **Handspeak** - Search results](https://www.google.com/search?&q=site%3Ahandspeak.com+ask)\n[🧬 **Lifeprint** - Search results](https://www.google.com/search?&q=site%3Alifeprint.com+ask)\n[🤝 **SigningSavvy** - Sign for ASK](https://www.signingsavvy.com/search/ask)\n[🌐 **Spread The Sign** - ASK](https://www.spreadthesign.com/en.us/search/?q=ask)\n[📹 **YouGlish** - ASL videos containing ASK](https://youglish.com/pronounce/ask/signlanguage/asl)\n'),
128+
EmbedProxy(inline=True, name='NEED', value='[👋 **Handspeak** - Search results](https://www.google.com/search?&q=site%3Ahandspeak.com+need)\n[🧬 **Lifeprint** - Search results](https://www.google.com/search?&q=site%3Alifeprint.com+need)\n[🤝 **SigningSavvy** - Sign for NEED](https://www.signingsavvy.com/search/need)\n[🌐 **Spread The Sign** - NEED](https://www.spreadthesign.com/en.us/search/?q=need)\n[📹 **YouGlish** - Videos containing NEED](https://youglish.com/pronounce/need/signlanguage/asl)\n'),
129+
EmbedProxy(inline=True, name='ASK', value='[👋 **Handspeak** - Search results](https://www.google.com/search?&q=site%3Ahandspeak.com+ask)\n[🧬 **Lifeprint** - Search results](https://www.google.com/search?&q=site%3Alifeprint.com+ask)\n[🤝 **SigningSavvy** - Sign for ASK](https://www.signingsavvy.com/search/ask)\n[🌐 **Spread The Sign** - ASK](https://www.spreadthesign.com/en.us/search/?q=ask)\n[📹 **YouGlish** - Videos containing ASK](https://youglish.com/pronounce/ask/signlanguage/asl)\n'),
130130
],
131131
footer=EmbedProxy(),
132132
image=EmbedProxy(),
@@ -140,7 +140,7 @@
140140
},
141141
}
142142
---
143-
# name: test_howsign[tiger]
143+
# name: test_sign[tiger]
144144
<class 'dict'> {
145145
'embed': <class 'Embed'> {
146146
Empty=Embed.Empty,
@@ -152,7 +152,7 @@
152152
[🧬 **Lifeprint** - Search results](https://www.google.com/search?&q=site%3Alifeprint.com+tiger)
153153
[🤝 **SigningSavvy** - Sign for TIGER](https://www.signingsavvy.com/search/tiger)
154154
[🌐 **Spread The Sign** - TIGER](https://www.spreadthesign.com/en.us/search/?q=tiger)
155-
[📹 **YouGlish** - ASL videos containing TIGER](https://youglish.com/pronounce/tiger/signlanguage/asl)
155+
[📹 **YouGlish** - Videos containing TIGER](https://youglish.com/pronounce/tiger/signlanguage/asl)
156156

157157
',
158158
fields=<class 'list'> [
@@ -169,7 +169,7 @@
169169
},
170170
}
171171
---
172-
# name: test_howsign[what's up]
172+
# name: test_sign[what's up]
173173
<class 'dict'> {
174174
'embed': <class 'Embed'> {
175175
Empty=Embed.Empty,
@@ -181,7 +181,7 @@
181181
[🧬 **Lifeprint** - Search results](https://www.google.com/search?&q=site%3Alifeprint.com+what%27s+up)
182182
[🤝 **SigningSavvy** - Sign for WHAT'S UP](https://www.signingsavvy.com/search/what%27s+up)
183183
[🌐 **Spread The Sign** - WHAT'S UP](https://www.spreadthesign.com/en.us/search/?q=what%27s+up)
184-
[📹 **YouGlish** - ASL videos containing WHAT'S UP](https://youglish.com/pronounce/what%27s+up/signlanguage/asl)
184+
[📹 **YouGlish** - Videos containing WHAT'S UP](https://youglish.com/pronounce/what%27s+up/signlanguage/asl)
185185

186186
',
187187
fields=<class 'list'> [
@@ -198,7 +198,7 @@
198198
},
199199
}
200200
---
201-
# name: test_howsign[||need, ask||]
201+
# name: test_sign[||need, ask||]
202202
<class 'dict'> {
203203
'embed': <class 'Embed'> {
204204
Empty=Embed.Empty,
@@ -222,7 +222,7 @@
222222
},
223223
}
224224
---
225-
# name: test_howsign[||tiger||]
225+
# name: test_sign[||tiger||]
226226
<class 'dict'> {
227227
'embed': <class 'Embed'> {
228228
Empty=Embed.Empty,
@@ -251,7 +251,7 @@
251251
},
252252
}
253253
---
254-
# name: test_howsign[||what's up||]
254+
# name: test_sign[||what's up||]
255255
<class 'dict'> {
256256
'embed': <class 'Embed'> {
257257
Empty=Embed.Empty,

tests/test_bot.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"||need, ask||",
2020
),
2121
)
22-
def test_howsign(snapshot, word):
23-
result = bot.howsign_impl(word)
22+
def test_sign(snapshot, word):
23+
result = bot.sign_impl(word)
2424
assert result == snapshot
2525

2626

0 commit comments

Comments
 (0)