Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ultrax

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ultrax - npm Package Compare versions

Comparing version 1.5.6 to 1.6.2

.replit

5

functions/bin.js

@@ -0,1 +1,6 @@

/**
* Bin a code
* @param {String} code Code to be bin
* @returns {Promise<String>}
*/
module.exports = async (code) => {

@@ -2,0 +7,0 @@ // replaces all '`' with air.

const buttonss = require("./non-public-functions/buttons")
const Discord = require("discord.js");
/**
* A button paginator
* @param {String} message The main message content
* @param {Discord.MessageEmbed[]} pages An array of embeds
* @param {Object} [buttons] An array of message components (buttons)
* @param {Number} [time] The timeout
*/
module.exports = async (message, pages, buttons = [], time = 60000) => {

@@ -3,0 +12,0 @@ if (!message) throw new ReferenceError('EmbedPages => "message" is not defined')

const invites = {};
const Discord = require("discord.js");
/**
* Invite Logger system in Discord bot using discord.js
* @param {Discord.Client} client
* @returns {Promise<void>}
*/
module.exports = async (client) => {

@@ -3,0 +10,0 @@ // Initialize the invite cache

@@ -69,2 +69,7 @@ module.exports = async function buttonss(content, options, client, message) {

custom_id: x.id || null,
emoji: {
name: null,
id: null,
animated: false,
},
url: x.url || null

@@ -71,0 +76,0 @@ }

@@ -0,1 +1,6 @@

/**
* Generates a password
* @param {Number} Length The length of the password characters
* @returns {Promise<String>}
*/
function passGen(Length) {

@@ -2,0 +7,0 @@ if (!Length) throw new TypeError("Length isn't specified")

@@ -0,1 +1,6 @@

/**
* SLeep-based Timeout function
* @param {Number} milliseconds Sleep time (ms)
* @returns {Promise<void>}
*/
function sleep(milliseconds) {

@@ -2,0 +7,0 @@ if (!milliseconds) throw new TypeError("Time isn't specified")

18

functions/welcomeImage.js

@@ -0,4 +1,16 @@

const Canvas = require("canvas");
const Discord = require("discord.js");
/**
* Create a welcome image for Discord bot using discord.js
* @param {String} background The image background
* @param {String} avatar The avatar
* @param {String} text_1 The title
* @param {String} text_2 The subtitle
* @param {String} text_3 The footer
* @param {String} color The color (hex code)
* @param {String | Object} settings The attachment
* @returns {Discord.MessageAttachment}
*/
module.exports = async function welcomeImage(background, avatar, text_1, text_2, text_3, color, settings) {
const Canvas = require('canvas')
const discord = require('discord.js')
if(!background) throw new SyntaxError("welcomeImage(background, avatar, text_1, text_2, text_3, color) ==> background is null.")

@@ -52,4 +64,4 @@ if(!background.endsWith('.png')) throw new Error("welcomeImage(background, avatar, text_1, text_2, text_3, color) ==> background must be a PNG.")

return new discord.MessageAttachment(canvas.create.toBuffer(), `${attachmentName}.png`);
return new Discord.MessageAttachment(canvas.create.toBuffer(), `${attachmentName}.png`);
}

8

index.js

@@ -7,3 +7,4 @@ const sleep = require('./functions/sleep'),

ButtonPaginator = require("./functions/button-embed-reactor"),
welcomeImage = require('./functions/welcomeImage')
welcomeImage = require('./functions/welcomeImage'),
Wikipedia = require('../classes/Wikipedia')

@@ -19,3 +20,4 @@

ButtonPaginator,
welcomeImage
};
welcomeImage,
Wikipedia
};
{
"name": "ultrax",
"version": "1.5.6",
"version": "1.6.2",
"description": "UltraX Package is a unique package that allows you to create cool things using simple functions and make it faster, for example there is an invite logger, discord buttons paginator, etc...",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -50,3 +50,3 @@

- You need a package called [**node-fetch**](https://npmjs.com/package/node-fetch) to use the [`Bin`](https://npmjs.com/package/ultrax#welcomeImage) function.
- You need a package called [**node-fetch**](https://npmjs.com/package/node-fetch) to use the [`Bin`](https://npmjs.com/package/ultrax#welcomeImage) and [`Wikipedia`](https://npmjs.com/package/ultrax#wikipedia)function.
- You need a package called [**canvas**](https://npmjs.com/package/canvas) to use the [`welcomeImage`](https://npmjs.com/package/ultrax#welcomeimage).

@@ -102,2 +102,4 @@

- [`Wikipedia`](https://npmjs.com/package/ultrax#wikipedia) - Function that allows users to search wikipedia and return results for a query.
**Events:**

@@ -345,2 +347,7 @@

emoji: {
name: '◀',
animated: false
},
id: 'back' // don't change this line

@@ -358,2 +365,7 @@

emoji: {
name: '▶',
animated: false
},
id: 'next' // don't change this line

@@ -485,3 +497,32 @@

```
## wikipedia
**A simple function to allow you to fetch a topic from wikipedia**
**Example**
```js
const ultrax = require('ultrax')
const prefix = "!" // require bots prefix
client.on('message', message => { // Client's message event
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(' '); //Defining Args
const command = args.shift().toLowerCase(); //defining command
if (command === "wikipedia") { //If a user does !wikipedia, this command will execute
let query = args.join(" ") //using args to define a search query, exmaple usage !wikipdia earth
if (!query) return message.channel.send('Please provide a search query') // Sending a message if a user does not provide a search query
const res = new ultrax.Wikipedia({ // Inistigating the wikipedia class
message: message, //The message
color: "RED", //Color of embed that will be sent
query: query //what the search query is
})
res.fetch() // fetching the result from wikipedia
}
});
```

@@ -488,0 +529,0 @@ # Events:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc