An open API service indexing awesome lists of open source software.

https://github.com/codemeapixel/virulent

A powerful JavaScript Library for the Discord API.
https://github.com/codemeapixel/virulent

Last synced: 8 months ago
JSON representation

A powerful JavaScript Library for the Discord API.

Awesome Lists containing this project

README

          

![](https://i.imgur.com/1gqzxVd.png)

[![Build Passing](https://img.shields.io/badge/build-Passing%20-green.svg?style=flat)](https://github.com/TheRealToxicDev/Virulent)
[![Node](https://img.shields.io/badge/node-v12.16.2%20-blue.svg?style=flat)](https://nodejs.org/en/)
[![Version](https://img.shields.io/badge/virulent-v0.1.0-yellowgreen.svg)](https://github.com/TheRealToxicDev/Virulent)

Virulent is a powerful node.js module that allows you to interact with the Discord API. Unlike other JavaScript Discord libraries Virulent takes a object-oriented yet slightly more sophisticated approach making your bot's code significantly tidier and easier to comprehend.

## Installation
Install Virulent using [`github`](https://www.github.com):

```bash
npm i --save github:TheRealToxicDev/Virulent
```

Aditionally you can Install the Virulent Module via your Package.json
by adding the following line under your List of Dependencies.

```bash
"virulent": "https://github.com/TheRealToxicDev/Virulent"
```

Example Package.json

```bash
{
"name": "virulent",
"version": "1.0.0",
"description": "Official Sample Bot for the Virulent Discord Library.",
"main": "bot.js",
"scripts": {
"start": "node bot.js"
},
"engines": {
"node": "12.16.2"
},
"keywords": [
"discord",
"api",
"client",
"javascript"
],
"author": "Toxic Dev",
"license": "Apache-2.0",
"dependencies": {
"virulent": "https://github.com/TheRealToxicDev/Virulent"
}
}
```

Or [`npm`](https://www.npmjs.com/):

```bash
Coming Soon (Nowhere near ready for that)
```

## Usage
Import the required components. For example the Virulent Module requirement looks like this:
```jsx harmony
const Discord = require ('virulent');
```
Then use it in your bots ``index.js`` as a string or callback.

```jsx harmony
'use strict';

const Discord = require('virulent');
const client = new Discord.Client();

// Insert Ready or Message event Here.

client.login(''); // put your bot token here
```
Usage Ping Example
```jsx harmony
'use strict';

const Discord = require('virulent');
const client = new Discord.Client();

client.on('ready', async (client) => {
const self = await client.getSelf();
console.log(`${self.username}#${self.discriminator} is online !`);
await client.setPresence({ game: { name: 'Hello, World!' } });
});

client.on('message', (message) => {
if (message.content.startsWith('!ping')) {
client.sendMessage(message.channel_id, {
content: 'Pong!'
}).catch(console.error);
}
});

client.login(''); // put your bot token here
```

# Support
If you need help you can join the [Virulent Support Server](https://discord.gg/aKqSx9G)
Or check out our [Documentation](https://virulentjs.site)