33import asyncio
44from datetime import datetime
55import re
6- import requests
76from typing import AsyncGenerator
87
98import aiohttp
@@ -19,14 +18,18 @@ async def get_github_issues(message: discord.Message) -> AsyncGenerator[dict, No
1918
2019 If a request error occurs, it sends a message and stops.
2120 """
22- matches = re .findall ("(?=((^| )#[0-9]+e ?($| )))" , message .content )
21+ matches = re .findall ("(?=((^| )#[0-9]+(e|u) ?($| )))" , message .content )
2322
2423 async with aiohttp .ClientSession () as session :
2524 for i in matches :
2625 issue = i [0 ].strip ("#e " )
27- repo = ("numworks/epsilon"
28- if "e" in i [0 ]
29- else "omega-numworks/omega" )
26+ issue = issue .strip ("#u " )
27+ if "e" in i [0 ]:
28+ repo = "numworks/epsilon"
29+ elif "u" in i [0 ]:
30+ repo = "UpsilonNumworks/Upsilon"
31+ else :
32+ repo = "omega-numworks/omega"
3033
3134 async with session .get (f"https://api.github.com/repos/{ repo } /issues/{ issue } " ) as response :
3235 if response .status != 200 :
@@ -157,7 +160,7 @@ async def on_message(self, message):
157160 await message .channel .send (embed = color_embed )
158161
159162 # Check if the message has an issue identifier in it
160- if re .search ("(^| )#[0-9]+e ?($| )" , message .content ):
163+ if re .search ("(^| )#[0-9]+(e|u) ?($| )" , message .content ):
161164 async for i in get_github_issues (message ):
162165 # Create an embed with the data from the issue
163166 embed = await make_embed (i )
@@ -170,6 +173,7 @@ async def on_message(self, message):
170173
171174 # After 60 seconds, it deletes it from the storage dictionary.
172175 await asyncio .sleep (60 )
176+ await issue_embed .remove_reaction ("🗑️" , self .bot .user )
173177 self .issue_embeds .pop (issue_embed .id )
174178
175179 @commands .Cog .listener ()
0 commit comments