(interaction, targetUser, notes, guildId)
| 237 | } |
| 238 | |
| 239 | async function handleClearNotes(interaction, targetUser, notes, guildId) { |
| 240 | const noteCount = notes.length; |
| 241 | |
| 242 | if (noteCount === 0) { |
| 243 | return InteractionHelper.safeReply(interaction, { |
| 244 | embeds: [ |
| 245 | infoEmbed( |
| 246 | "No Notes to Clear", |
| 247 | `There are no notes for **${targetUser.tag}** to clear.` |
| 248 | ), |
| 249 | ], |
| 250 | }); |
| 251 | } |
| 252 | |
| 253 | notes.length = 0; |
| 254 | |
| 255 | const notesKey = getUserNotesKey(guildId, targetUser.id); |
| 256 | await setInDb(notesKey, notes); |
| 257 | |
| 258 | return InteractionHelper.safeReply(interaction, { |
| 259 | embeds: [ |
| 260 | successEmbed( |
| 261 | "🗑️ Notes Cleared", |
| 262 | `Cleared **${noteCount}** notes from **${targetUser.tag}**.` |
| 263 | ) |
| 264 | ] |
| 265 | }); |
| 266 | } |
| 267 | |
| 268 | function getNoteTypeInfo(type) { |
| 269 | const types = { |
no test coverage detected