mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-25 23:21:25 +00:00
Fix bot token reset
This commit is contained in:
@@ -67,8 +67,9 @@ router.post(
|
||||
},
|
||||
}),
|
||||
async (req: Request, res: Response) => {
|
||||
const app = await Application.findOneOrFail({ where: { id: req.params.application_id as string } });
|
||||
const bot = await User.findOneOrFail({ where: { id: req.params.application_id as string } });
|
||||
const owner = req.user;
|
||||
const owner = await User.findOneOrFail({ where: { id: app.owner_id }, select: { id: true, totp_secret: true } });
|
||||
|
||||
if (owner.id != req.user_id) throw DiscordApiErrors.ACTION_NOT_AUTHORIZED_ON_APPLICATION;
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ import { MessageOptions, sendMessage } from "../handlers/Message";
|
||||
import { Message } from "@spacebar/database";
|
||||
|
||||
export async function generatePollResultsMessage(options: MessageOptions): Promise<MessageOptions> {
|
||||
const message = await Message.create({
|
||||
// TODO: shouldnt this get saved?
|
||||
const message = Message.create({
|
||||
...options,
|
||||
message_reference: options.message_reference ?? undefined,
|
||||
poll: options.poll,
|
||||
|
||||
Reference in New Issue
Block a user