Skip to content

Commit

Permalink
discord-together v1.3.3
Browse files Browse the repository at this point in the history
2 new games added : 
- sketchheads
- ocho

Test folder updated
Readme updated
Types updates
  • Loading branch information
RemyK888 authored Feb 7, 2022
1 parent bf26326 commit 95f1698
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 10 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $ npm install discord.js@latest
- Multiple server
- Discord support
- Lightweight
- 15+ games available
- 18+ games available

<br/>

Expand All @@ -34,15 +34,15 @@ This is a simple example of code using this package.

```js
const Discord = require('discord.js');
const client = new Discord.Client();
const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });
const { DiscordTogether } = require('discord-together');

client.discordTogether = new DiscordTogether(client);

client.on('messageCreate', async message => { // 'message' for Discord.js v12
client.on('messageCreate', async message => {
if (message.content === 'start') {
if(message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'doodlecrew').then(async invite => {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'sketchheads').then(async invite => {
return message.channel.send(`${invite.code}`);
});
};
Expand Down Expand Up @@ -139,13 +139,20 @@ client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'putt
});
```

- Sketch Heads
- Sketchheads
```js
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'sketchheads').then(async invite => {
return message.channel.send(`${invite.code}`);
});
```

- Ocho
```js
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'ocho').then(async invite => {
return message.channel.send(`${invite.code}`);
});
```

# 📷 Image

![Invite link](https://media.discordapp.net/attachments/835896457454026802/837968506846183474/2021-05-01_10h26_17.png)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "discord-together",
"version": "1.3.3",
"description": "Play games or watch YouTube videos together on Discord! More than 15 games available!",
"description": "Play games or watch YouTube videos together on Discord! More than 18 games available!",
"main": "index.js",
"types": "./types/index.d.ts",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/DiscordTogether.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const defaultApplications = {
spellcast: '852509694341283871', // Note : First package to offer spellcast, any other package offering it will be clearly inspired by it
checkers: '832013003968348200', // Note : First package to offer checkers, any other package offering it will be clearly inspired by it
puttparty: '763133495793942528', // Note : First package to offer puttparty, any other package offering it will be clearly inspired by it
sketchheads: '902271654783242291',
sketchheads: '902271654783242291', // Note : First package to offer sketchheads any other package offering it will be clearly inspired by it
ocho: '832025144389533716', // Note : First package to offer ocho any other package offering it will be clearly inspired by it
//sketchyartist: '879864070101172255' // Note : First package to offer sketchyartist, any other package offering it will be clearly inspired by it
};

Expand Down
17 changes: 17 additions & 0 deletions test/test-djs12.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const Discord = require('discord.js');
const client = new Discord.Client();
const { DiscordTogether } = require('../index.js');

client.discordTogether = new DiscordTogether(client);

client.on('message', async message => {
if (message.content === 'start') {
if(message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channelId, 'sketchheads').then(async invite => {
return message.channel.send(`${invite.code}`); // Click the blue link !
});
};
};
});

client.login('Discord bot token');
17 changes: 17 additions & 0 deletions test/test-djs13.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const Discord = require('discord.js');
const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] });
const { DiscordTogether } = require('../index.js');

client.discordTogether = new DiscordTogether(client);

client.on('messageCreate', async message => {
if (message.content === 'start') {
if(message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channel.id, 'sketchheads').then(async invite => {
return message.channel.send(`${invite.code}`); // Click the blue link !
});
};
};
});

client.login('Discord bot token');
8 changes: 5 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare class DiscordTogether<T extends {
*
* client.on('message', async message => {
* if (message.content === 'start') {
* client.discordTogether.createTogetherCode(message.member.voice.channelID, 'youtube').then(async invite => {
* client.discordTogether.createTogetherCode(message.member.voice.channelID, 'skeatchheads').then(async invite => {
* return message.channel.send(`${invite.code}`);
* });
* };
Expand Down Expand Up @@ -45,6 +45,7 @@ declare class DiscordTogether<T extends {
checkers: string;
puttparty: string;
sketchheads: string;
ocho: string;
} & T;
/**
* Create a Youtube Together invite code (note: send the invite using markdown link)
Expand All @@ -53,7 +54,7 @@ declare class DiscordTogether<T extends {
* @example
* client.on('message', async message => {
* if (message.content === 'start') {
* client.discordTogether.createTogetherCode(message.member.voice.channelID, 'spellcast').then(async invite => {
* client.discordTogether.createTogetherCode(message.member.voice.channelID, 'skeatchheads').then(async invite => {
* return message.channel.send(`${invite.code}`); // Click the blue link
* });
* };
Expand All @@ -76,7 +77,8 @@ declare class DiscordTogether<T extends {
checkers: string;
puttparty: string;
sketchheads: string;
ocho: string;
} & T)): Promise<{
code: string;
}>;
}
}

0 comments on commit 95f1698

Please sign in to comment.