Spaces:
Runtime error
Runtime error
Label -> Identify sound, display author name
Browse files
bot.py
CHANGED
@@ -134,13 +134,13 @@ def get_conf_score(confidence: str):
|
|
134 |
Option(name="label", description="The label for the image"),
|
135 |
Option(name="confidence", description="Choose your confidence: high, medium, low", autocomplete=confAutocomplete)
|
136 |
])
|
137 |
-
async def
|
138 |
|
139 |
improve_player_stats_image(ctx)
|
140 |
|
141 |
label_cnt = generate_id(f'cnt:label:image:{id}')
|
142 |
r.hset(f'label:image:{id}:{label_cnt}'.encode('utf-8'), b'label', label.encode('utf-8'))
|
143 |
-
r.hset(f'label:image:{id}:{label_cnt}'.encode('utf-8'), b'author', ctx.author.
|
144 |
conf_score = get_conf_score(confidence)
|
145 |
r.hset(f'label:image:{id}:{label_cnt}'.encode('utf-8'), b'confidence', conf_score)
|
146 |
|
@@ -195,7 +195,7 @@ async def sound(ctx, id): # a slash command will be created with the name "ping"
|
|
195 |
Option(name="timestamp", description="The timestamp of the observation"),
|
196 |
Option(name="confidence", description="Choose your confidence: high, medium, low", autocomplete=confAutocomplete)
|
197 |
])
|
198 |
-
async def
|
199 |
|
200 |
sound_cnt = generate_id(f'cnt:label:sound:{id}')
|
201 |
r.hset(f'label:sound:{id}:{sound_cnt}'.encode('utf-8'), b'label', label.encode('utf-8'))
|
|
|
134 |
Option(name="label", description="The label for the image"),
|
135 |
Option(name="confidence", description="Choose your confidence: high, medium, low", autocomplete=confAutocomplete)
|
136 |
])
|
137 |
+
async def identify_image(ctx, id:int, label:str, confidence: str):
|
138 |
|
139 |
improve_player_stats_image(ctx)
|
140 |
|
141 |
label_cnt = generate_id(f'cnt:label:image:{id}')
|
142 |
r.hset(f'label:image:{id}:{label_cnt}'.encode('utf-8'), b'label', label.encode('utf-8'))
|
143 |
+
r.hset(f'label:image:{id}:{label_cnt}'.encode('utf-8'), b'author', ctx.author.name.encode('utf-8'))
|
144 |
conf_score = get_conf_score(confidence)
|
145 |
r.hset(f'label:image:{id}:{label_cnt}'.encode('utf-8'), b'confidence', conf_score)
|
146 |
|
|
|
195 |
Option(name="timestamp", description="The timestamp of the observation"),
|
196 |
Option(name="confidence", description="Choose your confidence: high, medium, low", autocomplete=confAutocomplete)
|
197 |
])
|
198 |
+
async def identify_sound(ctx, id:int, label:str, timestamp:str, confidence: str):
|
199 |
|
200 |
sound_cnt = generate_id(f'cnt:label:sound:{id}')
|
201 |
r.hset(f'label:sound:{id}:{sound_cnt}'.encode('utf-8'), b'label', label.encode('utf-8'))
|