File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ export async function findPollForEmbedMessage(
7777 return await polls . findPollForEmbedMessage ( embedMessage . id ) ;
7878}
7979
80+ export async function deletePoll ( id : PollId ) {
81+ return await polls . deletePoll ( id ) ;
82+ }
83+
8084export async function countDelayedVote (
8185 poll : Poll ,
8286 message : Message < true > ,
Original file line number Diff line number Diff line change @@ -182,6 +182,10 @@ export async function findPollForEmbedMessage(
182182 } ) ;
183183}
184184
185+ export async function deletePoll ( id : PollId , ctx = db ( ) ) : Promise < Poll > {
186+ return ctx . deleteFrom ( "polls" ) . where ( "id" , "=" , id ) . returningAll ( ) . executeTakeFirstOrThrow ( ) ;
187+ }
188+
185189export async function markPollAsEnded ( pollId : PollId , ctx = db ( ) ) : Promise < void > {
186190 await ctx
187191 . updateTable ( "polls" )
You can’t perform that action at this time.
0 commit comments