@@ -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 = cls ._getRepoId (cls , handler )
395+ repoId = await cls ._getRepoId_async (cls , handler )
385396 bugLabel = "LA_kwDOJ3JPj88AAAABU1q15w"
386397 autoLabel = "LA_kwDOJ3JPj88AAAABU1q2DA"
387398
@@ -414,10 +425,15 @@ def manualBugReport(cls, repoName: str, errorTitle: str, errorMessage: str) -> N
414425 }
415426 }
416427
417- issueExists = cls ._checkIfIssueExists (cls , handler , errorTitle )
428+ issueExists = await cls ._checkIfIssueExists_async (cls , handler , errorTitle )
429+
430+ # Send to Discord if applicable
431+ if cls .handlers [repoName ].useDiscord :
432+ discordBot = DiscordBot (cls .handlers [repoName ].botToken , cls .handlers [repoName ].channelId )
433+ await discordBot .send_message (f"## { repoName } : { errorTitle } \n { errorMessage } " , issueExists )
418434
419435 if (issueExists == False ):
420- result = asyncio . run ( client .execute_async (query = createIssue , variables = variables , headers = headers ) )
436+ result = await client .execute_async (query = createIssue , variables = variables , headers = headers )
421437 print ('\n This error has been reported to the Tree Growth team.\n ' )
422438 else :
423439 print ('\n Our team is already aware of this issue.\n ' )
0 commit comments