@@ -366,6 +366,17 @@ async def _getRepoId_async(self, handler: BugHandler) -> str:
366366 def manualBugReport (cls , repoName : str , errorTitle : str , errorMessage : str ) -> None :
367367 """Manually sends a bug report to the Github repository.
368368
369+ Args:
370+ repoName (str): the name of the repo to report to
371+ errorTitle (str): the title of the error
372+ errorMessage (str): the error message
373+ """
374+ asyncio .run (cls .manualBugReportAsync (repoName ,errorTitle ,errorMessage ))
375+
376+ @classmethod
377+ async def manualBugReportAsync (cls , repoName : str , errorTitle : str , errorMessage : str ) -> None :
378+ """Manually sends a bug report to the Github repository.
379+
369380 Args:
370381 repoName (str): the name of the repo to report to
371382 errorTitle (str): the title of the error
@@ -381,7 +392,7 @@ def manualBugReport(cls, repoName: str, errorTitle: str, errorMessage: str) -> N
381392 headers = {"Authorization" : f"Bearer { handler .githubKey } " }
382393
383394 # query variables
384- repoId = asyncio . run ( cls ._getRepoId_async (cls , handler ) )
395+ repoId = await cls ._getRepoId_async (cls , handler )
385396 bugLabel = "LA_kwDOJ3JPj88AAAABU1q15w"
386397 autoLabel = "LA_kwDOJ3JPj88AAAABU1q2DA"
387398
@@ -414,15 +425,15 @@ def manualBugReport(cls, repoName: str, errorTitle: str, errorMessage: str) -> N
414425 }
415426 }
416427
417- issueExists = asyncio . run ( cls ._checkIfIssueExists_async (cls , handler , errorTitle ) )
428+ issueExists = await cls ._checkIfIssueExists_async (cls , handler , errorTitle )
418429
419430 # Send to Discord if applicable
420431 if cls .handlers [repoName ].useDiscord :
421432 discordBot = DiscordBot (cls .handlers [repoName ].botToken , cls .handlers [repoName ].channelId )
422- asyncio . run ( discordBot .send_message (f"## { repoName } : { errorTitle } \n { errorMessage } " , issueExists ) )
433+ await discordBot .send_message (f"## { repoName } : { errorTitle } \n { errorMessage } " , issueExists )
423434
424435 if (issueExists == False ):
425- result = asyncio . run ( client .execute_async (query = createIssue , variables = variables , headers = headers ) )
436+ result = await client .execute_async (query = createIssue , variables = variables , headers = headers )
426437 print ('\n This error has been reported to the Tree Growth team.\n ' )
427438 else :
428439 print ('\n Our team is already aware of this issue.\n ' )
0 commit comments