1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
use ureq::{self};

const BASEURL: &str = "https://nekobot.xyz/api/";
const _DOCS: &str = "https://docs.nekobot.xyz/";
/* 
    The type of image to get. 
    Current types: hass, hmidriff, pgif, 4k, hentai, holo, hneko, neko, hkitsune, 
    kemonomimi, anal, hanal, gonewild, kanna, ass, pussy, thigh, 
    hthigh, gah, coffee, food, paizuri, tentacle, boobs, hboobs, 
    donator types: cosplay, swimsuit, pantsu 
*/
pub fn image(image_type: &str, auth: &str) -> ureq::SerdeValue {
    if auth == "" {
       let resp = ureq::get(&(BASEURL.to_owned() + "/image?type=" + image_type))
        .set("Content-Type", "application/json")
        .set("Authorization", auth).call().into_json().unwrap();
        return resp;
    } else {
        let resp =  ureq::get(&(BASEURL.to_owned() + "/image?type=" + image_type))
            .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    }
}

pub fn generate(generate: &str, text: &str, raw: &str) -> ureq::SerdeValue {
    if generate == "threats" {
        let resp =  ureq::get(&(BASEURL.to_owned()  + "imagegen?type=" + generate + "&url=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "baguette" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "clyde" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&text=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "ship" {
//1 Finish

    } else if generate == "captcha" {
// Finish

    } else if generate == "whowouldwin" {
//1 Finish

    } else if generate == "changemymind" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&text=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "ddlc" {
//

    } else if generate == "jpeg" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "lolice" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "kannagen" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&text=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "iphonex" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "kms" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "animeface" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&image=" + text))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "trap" {
// Finish

    } else if generate == "nichijou" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&text=" + text))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "awooify" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "trumptweet" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&text=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "tweet" {
// Finish

    } else if generate == "kidnap" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&image=" + text))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "deepfry" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&image=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "blurpify" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&image=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "phcomment" {
// Finish

    } else if generate == "magik" {
// Finish

    } else if generate == "deepfry" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&image=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "osu" {
// Finish

    } else if generate == "clickforhentai" { 
// Finish

    } else if generate == "fact" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&text=" + text + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "trash" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "stickbug" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=" + generate + "&url=" + text))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    }
    let resp =  ureq::get(&(BASEURL.to_owned() + "/api"))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp;
}
/*
    Deprecated
*/
pub fn osu(key: &str, username: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=osu&url=" + key + "&username=" + username))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}

pub fn clickforhentai(image: &str, fontsize: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=clickforhentai&image=" + image + "&fontsize=" + fontsize))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}

pub fn magik(image: &str, intensity: &str, raw: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=magik&image=" + image + "&intensity=" + intensity + "&raw=" + raw ))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}

pub fn trap(name: &str, author: &str, image: &str, raw: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=trip&image=" + image + "&name=" + name + "&author" + author + "&raw=" + raw ))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}

pub fn captcha(username: &str, image: &str, raw: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=trip&captcha=" + image + "&username=" + username + "&raw=" + raw ))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}

pub fn tweet(username: &str,  text: &str, raw: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=tweet&username=" + username + "&text=" + text + "&raw=" + raw))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}

pub fn phcomment(image: &str, username: &str,  text: &str, raw: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=phcomment&image=" + image + "&text=" + text + "&username=" + username + "&raw=" + raw))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}
/* 
aracter	string	
Can be either monika, yuri, natsuki, sayori or m, y, n, s

background	string	
Background of the image, types: bedroom, class, closet, club, corridor, house, kitchen, residential, sayori_bedroom

body	string	
Body of the character, there is only 1 or 2 for monika and 1, 1b, 2, 2b for the rest

face	string	
Face of the character to go with the body, is best to just see all the types at https://github.com/hibikidesu/NekoBot/blob/master/modules/fun.py#L14 (line14 to 34)

text	string	
Text for the character to say, max length of 140
*/
pub fn ddlc(character: &str, background: &str,  body: &str, face: &str, text: &str,  raw: &str) -> ureq::SerdeValue {
    let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=ddlc&character=" +  character + "&background=" + background + "&text=" + text + "&body=" + body + "&face=" + face + "&raw=" + raw))
    .set("Content-Type", "application/json").call().into_json().unwrap();
    return resp["message"].to_owned();
}

pub fn whowouldwin_or_ship(generate: &str, user1: &str,  user2: &str, raw: &str) -> ureq::SerdeValue {
    if generate == "whowouldwin" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=whowouldwin&user1=" + user1 + "&user2=" + user2 + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else if generate == "ship" {
        let resp =  ureq::get(&(BASEURL.to_owned() + "imagegen?type=ship&user1=" + user1 + "&user2=" + user2 + "&raw=" + raw))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp["message"].to_owned();
    } else {
        let resp =  ureq::get(&(BASEURL.to_owned() + "/api"))
        .set("Content-Type", "application/json").call().into_json().unwrap();
        return resp;       
    }
}