We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b17dfc9 commit 7c8f622Copy full SHA for 7c8f622
src/utils/WebManager.ts
@@ -99,8 +99,12 @@ export default class WebManager {
99
100
async testMessage(req: Req<{ user: string }>, res: Res): Promise<void> {
101
const userid = req.params.user
102
- const user = await client.users.fetch(userid)
103
- await user.send("This is a test")
104
- res.sendStatus(200)
+ try {
+ const user = await client.users.fetch(userid)
+ await user.send("This is a test message")
105
+ res.sendStatus(200)
106
+ } catch (error) {
107
+ res.status(400).send("Could not message")
108
+ }
109
}
110
0 commit comments