🛠️ Bug Fixes
🚀 All commands are now bug-free and operational!
Greetings everyone! 🌟 This marks the release of a beta version for our package. If you encounter any issues or need assistance, feel free to reach out. Direct message me on Discord at elias79
(ID: 1130583393176920095).
🚫 Functions Removed and Deprecated
❌ Removed Functions
- The
initeHandler()
function is no longer available. To connect to Lavalink, include the required configuration in the start()
function. Refer to the example and usage provided below. processMessage()
has been deprecated and replaced with pixelAI()
.
⚠️ Deprecated Function
mongoConnect()
is now deprecated and can be used in the start()
function.
🚀 Getting Started
- If you're new and facing issues or unable to register and execute commands (slash / prefix).
- Use the code snippet below (Note: This may slightly increase bot latency by approximately 50ms).
const { Client, GatewayIntentBits, Partials } = require("discord.js");
const { start } = require('zenith-bot');
const path = require('path');
const client = new Client({
intents: Object.keys(GatewayIntentBits).map((a)=>{
return GatewayIntentBits[a]
}),
partials: Object.values(Partials),
});
const token = process.env.token;
const eventsPath = path.join(__dirname, 'src', 'events');
const prefixCommandPath = path.join(__dirname, 'src', 'prefix');
const options = {
token: token,
status: 'online',
name: 'Playing with commands',
type: 0,
botName: 'tools',
botAvatar: './pfp.jpeg',
eventsPath,
slashCommandPath: {
baseDir: __dirname,
path: './src/slash',
global: true,
guildId: '',
logsId: '',
},
prefixCommandPath: {
path: prefixCommandPath,
logsId: '',
prefix: '!',
},
lavalink: {
nodes: [],
search: 'ytmsearch',
version: 'v4',
},
mongo: {
mognoURI: '',
dataName: '',
}
};
start(client, options);
🚀 What's New
🌟 Bot Enhancements
- Implemented a comprehensive bot handler for managing slash commands, prefix settings, MongoDB integration for database functionality, Lavalink for music streaming, and enhanced event handling for the client.
🎨 PaintImage Class Update
- Added a new option to the
PaintImage
class for Gif. Now you can make gif images.
🚀 Usage Guidelines 🤖
For a standard reply without AI images or voice messages, set both draw
and voice
to false
. Activate voice replies and AI images by setting them to true
. Trigger the bot to draw AI images with specific words or phrases using drawTrigger
.
Note soon pixelAI will be converted into api and it will require ApiKeys.
const { pixelAI } = require('zenith-bot');
import { pixelAI } from 'zenith-bot';
const allowedChannelId = 'Channel_ID';
client.on('messageCreate', async (message) => {
if (message.author.bot || message.channel.id !== allowedChannelId) return;
await pixelAI(message, {
voice: false,
draw: true,
drawTrigger: ['create', 'draw', 'imagine', 'ارسم'],
imageModel: 'prodia',
chatModel: 'v3-32k',
keywords: ['bot name', 'your name', 'who are you'],
keywordResponses: {
'bot name': 'My name is Zenith, and I was developed by Elias79.',
'your name': 'I am known as Zenith, created by Elias79.',
'who are you': 'I am Zenith, an AI created by Elias79.',
},
});
});
📊 Database Connection 📁
To connect to MongoDB/Mongoose, provide your URL and name your database. Follow these steps:
const { mongoConnect } = require('zenith-bot');
import { mongoConnect } from 'zenith-bot';
const mongoSuccess = await mongoConnect('mongoURI', 'dbName');
const mongoDb = getDb();
const { save, updateData, find, remove, removeSpecific } = require('zenith-bot');
await save('collectionName', { key: 'value', key2: 'value2' });
await updateData('collectionName', { key: 'value' }, { $set: { key2: 'new-value' } }, updateData);
await find('collectionName', { key: 'value' });
await remove('collectionName', { key: 'value' });
await removeSpecific('collectionName', { key: 'value' }, {key2: 'value'});
await removeMany('collectionName', { keyToMatch: 'someValue' });
const keysToDelete = 'yourField';
const keyToKeep = 'anotherField';
removeManyExcept('yourCollection', keysToDelete, keyToKeep);
const filter = { keyToMatch: 'someValue' };
const update = { $set: { keyToUpdate: 'newValue' } };
await updateMany('collectionName', filter, update);
const filter = { keyToMatch: 'someValue' };
const update = { keyToUpdate: 'newValue' };
const excludedKeys = ['keyToExclude1', 'keyToExclude2'];
await updateManyExcept('collectionName', filter, update, excludedKeys);
await transferData('sourceCollection', 'destinationCollection');
await transferDataAndDelete('sourceCollection', 'destinationCollection');
📸 Manipulating Images Using Canvas 🎨
Add images, shapes, and effects to images with ease!
const { PaintImage } = require('zenith-bot');
const paintImage = new PaintImage();
const canvasOptions = {
width: 1200,
height: 300,
backgroundColor: '#3498db',
backgroundGradient: {
type: 'linear',
startX: 0,
startY: 0,
startRadius: 0,
endRadius: 0,
endX: 100,
endY: 0,
colors: [
{ stop: 0, color: 'red' },
{ stop: 0.5, color: 'green' },
{ stop: 1, color: 'blue' },
],
},
borderRadius: 0,
};
const images = [
{
source: 'square',
x: 385,
y: 225,
rotate: 0,
filled: true,
width: 500,
height: 80,
borderRadius: 35,
color: 'rgba(0, 0, 0, 0.4)',
gradient:,
stroke: {
color: '#498afc',
width: 5,
borderRadius: 35,
},
},
{
source: 'square',
x: 395,
y: 235,
rotate: 0,
filled: true,
width: 440,
height: 60,
borderRadius: 35,
gradient: {
type: 'linear',
startX: 0,
startY: 0,
endX: 100,
endY: 0,
colors: [
{ stop: 0, color: 'red' },
{ stop: 0.5, color: 'green' },
{ stop: 1, color: 'blue' },
],
},
},
{
source: 'local/file/path || image url',
x: 120,
y: 120,
width: 210,
height: 210,
borderRadius: 20,
shadow: {
color: null,
offsetX: 0,
offsetY: 0,
opacity: 0,
blur: 0,
borderRadius: null,
}
},
];
const image = await paintImage.drawImages(images, canvasOptions, __dirname);
const textOptionsArray = [
{
text: 'elias79. Rank',
x: 440,
y: 145,
fontName: 'Wind',
fontPath: './wind.ttf',
fontSize: 50,
color: 'white',
shadow: {
offsetX: 3,
offsetY: 3,
color: "rgba(0, 0, 0, 0.5)",
blur: 5
},
stroke: {
color: '#deff08',
width: 1.2,
},
},
{
text: '95/100 XP',
x: 530,
y: 250,
fontName: 'Arial',
fontSize: 35,
color: 'white',
stroke: {
color: 'black',
width: 0.5,
},
},
];
const buffer = await paintImage.addText(textOptionsArray, image, __dirname);
await message.channel.send({files: [buffer] });
How to make a gif
const images = [
{ source: "path/to/image1.jpg", isRemote: false },
{ source: "https://example.com/image2.png", isRemote: true },
];
const options = {
outputFormat: "file",
outputFile: "path/to/output.gif",
repeat: 0,
quality: 10,
canvasSize: { width: 1200, height: 1200 },
delay: 3000,
watermark: true,
textOverlay: {
text: "Your Text Here",
fontPath: "path/to/your/font.ttf",
fontName: "CustomFont",
fontSize: 20,
fontColor: "white",
x: 10,
y: 30,
},
basDir: __dirname,
};
(async () => {
await createGIF(images, options);
}) ();
📚 More Commands & Documentation 📖
Explore a detailed list of commands and their prefixes in our Support Server.
🚨 Important Notes 📌
-
Voice Messages: Currently in beta, occasional disruptions may occur.
-
Commands: Support for slash commands and database integration using MongoDB is coming soon.
-
Music: Utilizing Lavalink for audio streaming. Customize Lavalink node if needed.
-
Database: Still in beta. Aimed at simplicity and bug-free experience.
Keep experimenting, and feel free to contact me for assistance! Suggestions and adjustments are welcome. 🌟
Modal (Image)
- v1
- v2
- v2-beta
- lexica
- prodia
- animefy
- raava
- shonin
- v3
- 3Guofeng3_v34.safetensors [50f420de]
- absolutereality_V16.safetensors [37db0fc3]
- absolutereality_v181.safetensors [3d9d4d2b]
- amIReal_V41.safetensors [0a8a2e61]
- analog-diffusion-1.0.ckpt [9ca13f02]
- anythingv3_0-pruned.ckpt [2700c435]
- anything-v4.5-pruned.ckpt [65745d25]
- anythingV5_PrtRE.safetensors [893e49b9]
- AOM3A3_orangemixs.safetensors [9600da17]
- blazing_drive_v10g.safetensors [ca1c1eab]
- cetusMix_Version35.safetensors [de2f2560]
- childrensStories_v13D.safetensors [9dfaabcb]
- childrensStories_v1SemiReal.safetensors [a1c56dbb]
- childrensStories_v1ToonAnime.safetensors [2ec7b88b]
- Counterfeit_v30.safetensors [9e2a8f19]
- cuteyukimixAdorable_midchapter3.safetensors [04bdffe6]
- cyberrealistic_v33.safetensors [82b0d085]
- dalcefo_v4.safetensors [425952fe]
- deliberate_v2.safetensors [10ec4b29]
- deliberate_v3.safetensors [afd9d2d4]
- dreamlike-anime-1.0.safetensors [4520e090]
- dreamlike-diffusion-1.0.safetensors [5c9fd6e0]
- dreamlike-photoreal-2.0.safetensors [fdcf65e7]
- dreamshaper_6BakedVae.safetensors [114c8abb]
- dreamshaper_7.safetensors [5cf5ae06]
- dreamshaper_8.safetensors [9d40847d]
- edgeOfRealism_eorV20.safetensors [3ed5de15]
- EimisAnimeDiffusion_V1.ckpt [4f828a15]
- elldreths-vivid-mix.safetensors [342d9d26]
- epicrealism_naturalSinRC1VAE.safetensors [90a4c676]
- ICantBelieveItsNotPhotography_seco.safetensors [4e7a3dfd]
- juggernaut_aftermath.safetensors [5e20c455]
- lofi_v4.safetensors [ccc204d6]
- lyriel_v16.safetensors [68fceea2]
- majicmixRealistic_v4.safetensors [29d0de58]
- mechamix_v10.safetensors [ee685731]
- meinamix_meinaV9.safetensors [2ec66ab0]
- meinamix_meinaV11.safetensors [b56ce717]
- neverendingDream_v122.safetensors [f964ceeb]
- openjourney_V4.ckpt [ca2f377f]
- pastelMixStylizedAnime_pruned_fp16.safetensors [793a26e8]
- portraitplus_V1.0.safetensors [1400e684]
- protogenx34.safetensors [5896f8d5]
- Realistic_Vision_V1.4-pruned-fp16.safetensors [8d21810b]
- Realistic_Vision_V2.0.safetensors [79587710]
- Realistic_Vision_V4.0.safetensors [29a7afaa]
- Realistic_Vision_V5.0.safetensors [614d1063]
- redshift_diffusion-V10.safetensors [1400e684]
- revAnimated_v122.safetensors [3f4fefd9]
- rundiffusionFX25D_v10.safetensors [cd12b0ee]
- rundiffusionFX_v10.safetensors [cd4e694d]
- sdv1_4.ckpt [7460a6fa]
- v1-5-pruned-emaonly.safetensors [d7049739]
- v1-5-inpainting.safetensors [21c7ab71]
- shoninsBeautiful_v10.safetensors [25d8c546]
- theallys-mix-ii-churned.safetensors [5d9225a4]
- timeless-1.0.ckpt [7c4971d4]
- toonyou_beta6.safetensors [980f6b15]
chat Modals
- v3
- v3-32k
- turbo
- turbo-16k
- gemini