-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from Ayrox/dev
Dev
- Loading branch information
Showing
40 changed files
with
1,835 additions
and
101 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const { MessageEmbed, CommandInteraction } = require("discord.js"); | ||
const { errorEmbed } = require("../../util/Embeds") | ||
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); // eslint-disable-line | ||
|
||
|
||
module.exports = { | ||
|
||
name: "cat", | ||
description: "Random Cat Pictures", | ||
permission: "ADMINISTRATOR", | ||
active: true, | ||
|
||
/** | ||
* | ||
* @param {CommandInteraction} message | ||
*/ | ||
async execute(message) { | ||
|
||
try { | ||
|
||
await message.deferReply().catch(() => { }); | ||
|
||
const fetchAPI = async () => { | ||
const response = await fetch("https://some-random-api.ml/animal/cat", { | ||
method: "GET", | ||
}); | ||
return await response.json(); | ||
} | ||
|
||
const data = await fetchAPI(); | ||
|
||
|
||
const embed = new MessageEmbed() | ||
.setTitle("Cat Picture") | ||
.setColor("#00D7FF") | ||
.setDescription(data.fact) | ||
.setImage(data.image) | ||
.setFooter(`Requested by ${message.member.user.tag}`, message.member.displayAvatarURL()) | ||
.setTimestamp(); | ||
|
||
await message.editReply({ embeds: [embed] }); | ||
|
||
|
||
|
||
} catch (err) { | ||
console.log(err) | ||
return message.editReply({ embeds: [errorEmbed().setDescription(`Une erreur est survenue`)], ephemeral: true }) | ||
} | ||
|
||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
const { MessageEmbed, CommandInteraction } = require("discord.js"); | ||
const { errorEmbed } = require("../../util/Embeds") | ||
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args)); // eslint-disable-line | ||
|
||
|
||
module.exports = { | ||
|
||
name: "dog", | ||
description: "Random Dog Pictures", | ||
permission: "ADMINISTRATOR", | ||
active: true, | ||
|
||
/** | ||
* | ||
* @param {CommandInteraction} message | ||
*/ | ||
async execute(message) { | ||
|
||
try { | ||
|
||
await message.deferReply().catch(() => { }); | ||
|
||
const fetchAPI = async () => { | ||
const response = await fetch("https://some-random-api.ml/animal/dog", { | ||
method: "GET", | ||
}); | ||
return await response.json(); | ||
} | ||
|
||
const data = await fetchAPI(); | ||
|
||
const embed = new MessageEmbed() | ||
.setTitle("Dog Picture") | ||
.setColor("#00D7FF") | ||
.setDescription(data.fact) | ||
.setImage(data.image) | ||
.setFooter(`Requested by ${message.member.user.tag}`, message.member.displayAvatarURL()) | ||
.setTimestamp(); | ||
|
||
await message.editReply({ embeds: [embed] }); | ||
|
||
|
||
|
||
} catch (err) { | ||
console.log(err) | ||
return message.reply({ embeds: [errorEmbed().setDescription(`Une erreur est survenue`)], ephemeral: true }) | ||
} | ||
|
||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
const { errorEmbed } = require("../../util/Embeds") | ||
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); // eslint-disable-line | ||
const { MessageEmbed, CommandInteraction, Client, MessageAttachment } = require('discord.js'); | ||
|
||
|
||
module.exports = { | ||
|
||
name: "fakecomment", | ||
description: "Fakes a Youtube comment", | ||
permission: "ADMINISTRATOR", | ||
active : true, | ||
|
||
options: [ | ||
{ | ||
name: "comment", | ||
description: "what do you want to comment", | ||
type: "STRING", | ||
required: true, | ||
|
||
}, | ||
{ | ||
name: "user", | ||
description: "the user writing the comment", | ||
type: "USER", | ||
required: false | ||
} | ||
], | ||
|
||
/** | ||
* | ||
* @param {CommandInteraction} message | ||
* @param {Client} client | ||
*/ | ||
|
||
async execute(message,client) { | ||
|
||
try { | ||
|
||
await message.deferReply().catch(() => { }); | ||
|
||
let comment = message.options.getString("comment") | ||
let Target = message.options.getMember("user") | ||
|
||
if(!Target) Target = message.member | ||
|
||
const fetchAPI = async () => { | ||
const response = await fetch(`https://some-random-api.ml/canvas/youtube-comment?avatar=${Target.displayAvatarURL({format:"png"})}&username=${Target.user.username}&comment=${comment}`, { | ||
method: "GET", | ||
}); | ||
return await response; | ||
} | ||
|
||
|
||
const data = await fetchAPI(); | ||
|
||
|
||
const attach = new MessageAttachment(data.body, 'img.png'); | ||
|
||
const embed = new MessageEmbed() | ||
.setDescription(`**${Target}'s Youtube comment**`) | ||
.setColor("RED") | ||
.setImage(`attachment://img.png`) | ||
.setFooter(`Requested by ${message.member.user.tag}`, message.member.displayAvatarURL()) | ||
.setTimestamp(); | ||
|
||
await message.editReply({ embeds: [embed], files: [attach] }); | ||
|
||
|
||
|
||
} catch (err) { | ||
console.log(err) | ||
return message.editReply({ embeds: [errorEmbed().setDescription(`Une erreur est survenue`)], ephemeral: true }) | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
const { errorEmbed } = require("../../util/Embeds") | ||
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); // eslint-disable-line | ||
const { MessageEmbed, CommandInteraction, Client, MessageAttachment } = require('discord.js'); | ||
|
||
|
||
module.exports = { | ||
|
||
name: "faketweet", | ||
description: "Fakes a tweet", | ||
permission: "ADMINISTRATOR", | ||
active : true, | ||
|
||
options: [ | ||
{ | ||
name: "tweet", | ||
description: "what do you want to tweet", | ||
type: "STRING", | ||
required: true, | ||
|
||
}, | ||
{ | ||
name: "user", | ||
description: "the user writing the comment", | ||
type: "USER", | ||
required: false | ||
} | ||
], | ||
|
||
/** | ||
* | ||
* @param {CommandInteraction} message | ||
* @param {Client} client | ||
*/ | ||
|
||
async execute(message,client) { | ||
|
||
try { | ||
|
||
await message.deferReply().catch(() => { }); | ||
|
||
let tweet = message.options.getString("tweet") | ||
let Target = message.options.getMember("user") | ||
|
||
if(!Target) Target = message.member | ||
|
||
const fetchAPI = async () => { | ||
const response = await fetch(`https://some-random-api.ml/canvas/tweet?avatar=${Target.displayAvatarURL({format:"png"})}&username=${Target.user.username}&displayname=${ Target.nickname ? Target.nickname : Target.user.username }&comment=${tweet}`, { | ||
method: "GET", | ||
}); | ||
|
||
return await response; | ||
} | ||
|
||
|
||
const data = await fetchAPI(); | ||
|
||
|
||
const attach = new MessageAttachment(data.body, 'img.png'); | ||
|
||
const embed = new MessageEmbed() | ||
.setDescription(`**${Target}'s Tweet**`) | ||
.setColor("#00C5FF") | ||
.setImage(`attachment://img.png`) | ||
.setFooter(`Requested by ${message.member.user.tag}`, message.member.displayAvatarURL()) | ||
.setTimestamp(); | ||
|
||
await message.editReply({ embeds: [embed], files: [attach] }); | ||
|
||
|
||
|
||
} catch (err) { | ||
console.log(err) | ||
return message.editReply({ embeds: [errorEmbed().setDescription(`Une erreur est survenue`)], ephemeral: true }) | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.