Prettier 3

This commit is contained in:
Rory&
2025-12-17 07:44:04 +01:00
parent f935971c3d
commit 9963ea4527
7 changed files with 7 additions and 14 deletions
+1 -2
View File
@@ -45,8 +45,7 @@ router.post(
where: { id: guild_id },
select: ["owner_id"],
});
if (guild.owner_id !== req.user_id)
throw new HTTPError("You are not the owner of this guild", 401);
if (guild.owner_id !== req.user_id) throw new HTTPError("You are not the owner of this guild", 401);
await Promise.all([
Guild.delete({ id: guild_id }), // this will also delete all guild related data
@@ -41,8 +41,7 @@ router.delete(
});
// disable webauthn if there are no keys left
if (keys === 0)
await User.update({ id: req.user_id }, { webauthn_enabled: false });
if (keys === 0) await User.update({ id: req.user_id }, { webauthn_enabled: false });
res.sendStatus(204);
},
+1 -2
View File
@@ -16,8 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const alphabet =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+";
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+";
// binary to string lookup table
const b2s = alphabet.split("");
+1 -2
View File
@@ -20,6 +20,5 @@ import { Connection } from "./Connection";
import { RefreshableConnection } from "./RefreshableConnection";
export class ConnectionStore {
public static connections: Map<string, Connection | RefreshableConnection> =
new Map();
public static connections: Map<string, Connection | RefreshableConnection> = new Map();
}
+1 -2
View File
@@ -108,8 +108,7 @@ export async function initDatabase(): Promise<DataSource> {
if (!(await dbExists())) {
console.log("[Database] This appears to be a fresh database. Running initial DDL.");
const qr = dbConnection.createQueryRunner();
if (fs.existsSync(path.join(__dirname, "..", "migration", DatabaseType, "initial0.js")))
await new (require(`../migration/${DatabaseType}-initial`).initial0)().up(qr);
if (fs.existsSync(path.join(__dirname, "..", "migration", DatabaseType, "initial0.js"))) await new (require(`../migration/${DatabaseType}-initial`).initial0)().up(qr);
}
console.log("[Database] Applying missing migrations, if any.");
+1 -2
View File
@@ -18,8 +18,7 @@ export function parseGifResult(result: TenorGif) {
export function getGifApiKey() {
const { enabled, provider, apiKey } = Config.get().gif;
if (!enabled) throw new HTTPError(`Gifs are disabled`);
if (provider !== "tenor" || !apiKey)
throw new HTTPError(`${provider} gif provider not supported`);
if (provider !== "tenor" || !apiKey) throw new HTTPError(`${provider} gif provider not supported`);
return apiKey;
}
+1 -2
View File
@@ -3,8 +3,7 @@ import { VoicePayload } from "./Constants";
import { WebRtcWebSocket } from "./WebRtcWebSocket";
export function Send(socket: WebRtcWebSocket, data: VoicePayload) {
if (process.env.WRTC_WS_VERBOSE)
console.log(`[WebRTC] Outgoing message: ${JSON.stringify(data)}`);
if (process.env.WRTC_WS_VERBOSE) console.log(`[WebRTC] Outgoing message: ${JSON.stringify(data)}`);
let buffer: Buffer | string;