File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,26 +13,26 @@ export async function execWithContext(fn: (c: Context) => Promise<void>) {
1313 partials : [ Partials . Message , Partials . Channel , Partials . Reaction ] ,
1414 } ) ;
1515
16- const channel = await client . channels . fetch ( env . CHANNEL_ID ) ;
17- if ( ! channel ?. isTextBased ( ) ) {
18- console . error (
19- "指定チャンネルが見つからないか、テキストチャンネルではありません" ,
20- ) ;
21- return ;
22- }
23- if ( ! channel . isSendable ( ) ) {
24- console . error ( "チャンネルはメッセージ送信不可能です" ) ;
25- return ;
26- }
27-
28- const ctx : Context = {
29- env,
30- channel,
31- client,
32- } ;
33-
3416 client . once ( "ready" , async ( ) => {
3517 try {
18+ const channel = await client . channels . fetch ( env . CHANNEL_ID ) ;
19+ if ( ! channel ?. isTextBased ( ) ) {
20+ console . error (
21+ "指定チャンネルが見つからないか、テキストチャンネルではありません" ,
22+ ) ;
23+ return ;
24+ }
25+ if ( ! channel . isSendable ( ) ) {
26+ console . error ( "チャンネルはメッセージ送信不可能です" ) ;
27+ return ;
28+ }
29+
30+ const ctx : Context = {
31+ env,
32+ channel,
33+ client,
34+ } ;
35+
3636 await fn ( ctx ) ;
3737 } finally {
3838 client . destroy ( ) ;
You can’t perform that action at this time.
0 commit comments