discordware/user.py
def send_message(
        self, 
        channel_id: int, 
        content: str, 
        embeds: Type['Embed'] = [],
        tts: Optional[bool] = False,
        timestamp: Optional[datetime.datetime] = None
    ):

        """
        Send a message on a given channel id
        """
        if isinstance(embeds, Embed):
            embeds = embeds()
        elif isinstance(embeds, list):
            embeds = embeds

        message = Message(
            content = content, 
            tts = tts, 
            timestamp = timestamp,
            embeds = embeds
        )

        request = Route(
            Method.POST, 
            'channels/{}/messages'.format(channel_id)
        )

        result = request.send_with_data(
            self.header, message.to_dict
        ).json()

        if 'message' in result:
            error = "%s: %s" % (result.get('code'),
                result.get('message')
            )

            raise HTTPError(error)

        Send a message on a given channel id
        
Send a message on a given channel id
Send a message on a given channel id
def send_message(
        self, 
        channel_id: int, 
        content: str, 
        embeds: Type['Embed'] = [],
        tts: Optional[bool] = False,
        timestamp: Optional[datetime.datetime] = None
    ):
        if isinstance(embeds, Embed):
            embeds = embeds()
        elif isinstance(embeds, list):
            embeds = embeds
        message = Message(
            content = content, 
            tts = tts, 
            timestamp = timestamp,
            embeds = embeds
        )
        request = Route(
            Method.POST, 
            'channels/{}/messages'.format(channel_id)
        )
        result = request.send_with_data(
            self.header, message.to_dict
        ).json()
        if 'message' in result:
            error = "%s: %s" % (result.get('code'),
                result.get('message')
            )
            raise HTTPError(error)
def send_message ( self , channel_id : int , content : str , embeds : Type [ 'Embed' ] = [ ] , tts : Optional [ bool ] = False , timestamp : Optional [ datetime . datetime ] = None ) : if isinstance ( embeds , Embed ) : embeds = embeds ( ) elif isinstance ( embeds , list ) : embeds = embeds message = Message ( content = content , tts = tts , timestamp = timestamp , embeds = embeds ) request = Route ( Method . POST , 'channels/{}/messages' . format ( channel_id ) ) result = request . send_with_data ( self . header , message . to_dict ) . json ( ) if 'message' in result : error = "%s: %s" % ( result . get ( 'code' ) , result . get ( 'message' ) ) raise HTTPError ( error )
Send a message on a given channel id
Send a message on a given channel id
"""
        Send a message on a given channel id
        """
self
channel_id
int
content
str
embeds
Type['Embed']
tts
Optional[bool]
timestamp
Optional[datetime.datetime]