🎨 reformat

This commit is contained in:
Flam3rboy
2021-10-15 00:03:35 +02:00
parent fb3f957f30
commit bc85d6ff86
6 changed files with 7 additions and 13 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ export class FosscordServer extends Server {
api.use("*", (error: any, req: Request, res: Response, next: NextFunction) => {
if (error) return next(error);
res.status(404).json({
message: "404: Not Found",
message: "404 endpoint not found",
code: 0
});
next();
+1 -4
View File
@@ -40,17 +40,14 @@ router.post("/", route({ body: "EmojiCreateSchema", permission: "MANAGE_EMOJIS_A
const { guild_id } = req.params;
const body = req.body as EmojiCreateSchema;
const id = Snowflake.generate();
const emoji_count = await Emoji.count({ guild_id: guild_id });
const { maxEmojis } = Config.get().limits.guild;
if (emoji_count >= maxEmojis) throw DiscordApiErrors.MAXIMUM_NUMBER_OF_EMOJIS_REACHED.withParams(maxEmojis);
const id = Snowflake.generate();
if (body.require_colons == null) body.require_colons = true;
const user = await User.findOneOrFail({ id: req.user_id });
body.image = (await handleFile(`/emojis/${id}`, body.image)) as string;
const emoji = await new Emoji({