George-iam / Midjourney_api

unofficial Midjourney API
MIT License
421 stars 77 forks source link

[Question] How can I send `/info` command to midJourny with send_params.json #4

Closed jiangying000 closed 1 year ago

George-iam commented 1 year ago

Hi, you can send it with this function:

def info(self):
    header = {
        'authorization': self.authorization
    }
    payload = {
    "type":2 ,
    'application_id': self.application_id,
    'guild_id': self.guild_id,
    'channel_id': self.channelid,
    'session_id': self.session_id,
    "data":{
        "version": self.version,
        "id": self.id,
        "name":"info",
        "type":1,
        "options":[],
        "attachments":[]}
    }
    r = requests.post('https://discord.com/api/v9/interactions', json = payload , headers = header)
    return r

But I didn't find a way to receive /info messages because Midjourney internal api uses discord's ethemeral mode to send /info-messages, so you can't get it through discord's api