Skip to content

Commit

Permalink
Big update
Browse files Browse the repository at this point in the history
  • Loading branch information
zachey01 committed May 4, 2024
1 parent 57a731d commit 69e2aa4
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 42 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
TELEGTAM_TOKEN=
NIGHT_API_TOKEN=
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
.env
package-lock.json
test.js
package-lock.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
7 changes: 2 additions & 5 deletions bot.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
const { Telegraf } = require("telegraf");
const { Keyboard } = require("telegram-keyboard");
const axios = require("axios");
const bot = new Telegraf(process.env.TELEGTAM_TOKEN);
// Require сommands

let nswfYaoiImg = require("./commands/nswf/yaoi-img");
let nswfTrapImg = require("./commands/nswf/trap-img");
let nswfHentaiImg = require("./commands/nswf/hentai-img");
let startBtn = require("./handlers/buttons/start-btn");
let nswfImagesBtn = require("./handlers/buttons/nswfImages-btn");

// Сommands
bot.start(startBtn);
bot.command("back", startBtn);
bot.command("yaoi_img", nswfYaoiImg);
bot.command("trap_img", nswfTrapImg);
bot.command("hentai_img", nswfHentaiImg);
bot.command("images", nswfImagesBtn);
bot.command("videos", (ctx) => ctx.reply("coming soon..."));
// Launch

bot.launch();
15 changes: 7 additions & 8 deletions commands/nswf/hentai-img.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const axios = require("axios");
const nswfparse = require("nswfparse");

module.exports = async (ctx) => {
axios
.get("https://api.night-api.com/images/nsfw/hentai", {
headers: {
authorization: process.env.NIGHT_API_TOKEN,
},
nswfparse.reddit.hentai
.hentai()
.then((payload) => {
return ctx.replyWithPhoto(payload.url);
})
.then(function (response) {
return ctx.replyWithPhoto(response.data.content.url);
.catch((error) => {
console.error(error);
});
};
15 changes: 9 additions & 6 deletions commands/nswf/trap-img.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const { Telegraf } = require("telegraf");
const { message } = require("telegraf/filters");
const axios = require("axios");
const nswfparse = require("nswfparse");

module.exports = async (ctx) => {
axios.get("https://api.waifu.pics/nsfw/trap", {}).then(function (response) {
return ctx.replyWithPhoto(response.data.url);
});
nswfparse.reddit.hentai
.femboy()
.then((payload) => {
return ctx.replyWithPhoto(payload.url);
})
.catch((error) => {
console.error(error);
});
};
14 changes: 9 additions & 5 deletions commands/nswf/yaoi-img.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
const { Telegraf } = require("telegraf");
const { message } = require("telegraf/filters");
const r34API = require("r34.api");
const nswfparse = require("nswfparse");

module.exports = async (ctx) => {
let image = await r34API.rule34(["yaoi"]);
return ctx.replyWithPhoto(image.replace(/"/gi, ""));
nswfparse.reddit.hentai
.yaoi()
.then((payload) => {
return ctx.replyWithPhoto(payload.url);
})
.catch((error) => {
console.error(error);
});
};
Empty file removed commands/other/start.js
Empty file.
20 changes: 5 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "NSWF-tg-bot",
"name": "nswf-tg-bot",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand All @@ -10,19 +10,9 @@
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.4.0",
"dotenv": "^16.0.3",
"naughty-videos": "^1.0.2",
"porn-lib": "^1.4.1",
"r34.api": "^1.6.0",
"telegraf": "^4.12.2",
"telegram-keyboard": "^2.3.2",
"tslib": "^2.5.0",
"xvideos": "^0.0.4",
"xvideos-lib": "^1.1.21",
"xvideos-scraper": "^1.0.4"
},
"devDependencies": {
"nodemon": "^2.0.22"
"dotenv": "^16.4.5",
"nswfparse": "^3.1.2",
"telegraf": "^4.16.3",
"telegram-keyboard": "^2.3.5"
}
}

0 comments on commit 69e2aa4

Please sign in to comment.