@ -3,6 +3,8 @@ import traceback
import time
import io
from discord . utils import MISSING
class Extension :
core = None
def __init__ ( self , core ) :
@ -24,7 +26,8 @@ class Extension:
interaction : discord . Interaction = None ,
profile : str = " " ,
message : discord . Message = None ,
discord_user : discord . Member = None
discord_user : discord . Member = None ,
content_to_response : str = " "
) :
if interaction :
await interaction . response . defer ( thinking = True )
@ -47,15 +50,28 @@ class Extension:
if file and filename :
embed . set_image ( url = f " attachment:// { filename } " )
if interaction :
return await interaction . followup . send ( embed = embed , file = file , ephemeral = False )
return await interaction . followup . send (
content = content_to_response if content_to_response else MISSING ,
embed = embed ,
file = file ,
ephemeral = False )
if message :
return await message . channel . send ( embed = embed , file = file )
return await message . channel . send (
content = content_to_response if content_to_response else MISSING ,
embed = embed ,
file = file )
raise Exception ( ' Unknown processor ' )
else :
if interaction :
return await interaction . followup . send ( embed = embed , ephemeral = False )
return await interaction . followup . send (
content = content_to_response if content_to_response else MISSING ,
embed = embed ,
ephemeral = False )
if message :
return await message . channel . send ( embed = embed , ephemeral = False )
return await message . channel . send (
content = content_to_response if content_to_response else MISSING ,
embed = embed ,
ephemeral = False )
raise Exception ( ' Unknown processor ' )
async def __call__ ( self , * args , * * kwds ) :