Skip to content

Commit

Permalink
✨Allow multilingual image gen
Browse files Browse the repository at this point in the history
TecEash1 committed Mar 10, 2024

Verified

This commit was signed with the committer’s verified signature.
1 parent cb07c4f commit 7c08447
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion interactions/slash/misc/image.js
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@

const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const {XProdiaKey, Block_NSFW_Images} = require('../../../config.json')
const translate = require("@iamtraction/google-translate");
const axios = require('axios');
const tf = require('@tensorflow/tfjs-node');
const nsfw = require('nsfwjs');
@@ -107,16 +108,19 @@ module.exports = {

await interaction.deferReply();

const prompt = interaction.options.getString('prompt');
const style_preset = interaction.options.getString('style-preset');
const steps = interaction.options.getInteger('steps');
const cfg_scale = interaction.options.getInteger('cfg-scale');
const seed = interaction.options.getInteger('seed');
const sampler = interaction.options.getString('sampler');

let prompt = interaction.options.getString('prompt');
let negative_prompt = interaction.options.getString('negative-prompt');
let model = interaction.options.getString('model');

prompt = (await translate(prompt, { to: 'en' })).text;
negative_prompt = (await translate(negative_prompt, { to: 'en' })).text;

const nsfw_embed = new EmbedBuilder()
.setDescription(`**⚠️ NSFW content detected!**`)
.setColor('Red');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taurus",
"version": "2.0",
"version": "3.0",
"description": "An AI Discord Bot!",
"types": "./typings.d.ts",
"main": "bot.js",
@@ -24,6 +24,7 @@
},
"dependencies": {
"@google/generative-ai": "^0.2.1",
"@iamtraction/google-translate": "^2.0.1",
"@tensorflow/tfjs-node": "^4.17.0",
"api": "^6.1.1",
"axios": "^1.6.7",

0 comments on commit 7c08447

Please sign in to comment.