Skip to content

Commit

Permalink
Allow bot authentication for emoji add, update, and delete routes
Browse files Browse the repository at this point in the history
  • Loading branch information
SupertigerDev committed Jan 15, 2025
1 parent ec27909 commit 2c3254b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/routes/servers/serverEmojiAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { verifyUpload } from '../../common/nerimityCDN';
export function serverEmojiAdd(Router: Router) {
Router.post(
'/servers/:serverId/emojis',
authenticate(),
authenticate({allowBot: true}),
serverMemberVerification(),
memberHasRolePermissionMiddleware(ROLE_PERMISSIONS.ADMIN),
body('name')
Expand Down
2 changes: 1 addition & 1 deletion src/routes/servers/serverEmojiUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { addServerEmoji, updateServerEmoji } from '../../services/Server';

export function serverEmojiUpdate(Router: Router) {
Router.post('/servers/:serverId/emojis/:id',
authenticate(),
authenticate({allowBot: true}),
serverMemberVerification(),
memberHasRolePermissionMiddleware(ROLE_PERMISSIONS.ADMIN),
body('name')
Expand Down
4 changes: 1 addition & 3 deletions src/routes/servers/serverEmojisDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { deleteServerEmoji, getServerEmojis } from '../../services/Server';

export function serverEmojiDelete(Router: Router) {
Router.delete('/servers/:serverId/emojis/:id',
authenticate(),
authenticate({allowBot: true}),
serverMemberVerification(),
memberHasRolePermissionMiddleware(ROLE_PERMISSIONS.ADMIN),
rateLimit({
Expand All @@ -22,8 +22,6 @@ export function serverEmojiDelete(Router: Router) {
);
}



async function route(req: Request, res: Response) {

const [, error] = await deleteServerEmoji(req.serverCache.id, req.params.id);
Expand Down

0 comments on commit 2c3254b

Please sign in to comment.