forked from aspekts/Yunicassy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsave code
129 lines (80 loc) · 3.68 KB
/
save code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
const Discord = require('discord.js')
const Levels = require("discord-xp");
const canvacord = require("canvacord");
module.exports = {
name:'rank',
aliases:['level'],
description:'see your rank',
category:'Leveling',
async execute(client, message, args) {
const target = message.author;
const user = await Levels.fetch(target.id, message.guild.id);
const neededXp = Levels.xpFor(parseInt(user.level) + 3);
if(!user) return message.channel.send("**You currently have no XP. Send some messages to get some! :smile: **");
const rankcard = new canvacord.Rank()
.setAvatar(message.author.displayAvatarURL({ dynamic: true, format: 'png'}))
.setCurrentXP(user.xp)
setRequiredXP(neededXP)
.setStatus(message.member.presence.status)
.setProgressBar('#FFA500', "COLOR")
.setDiscriminator('0001')
.setUsername(message.author.username)
rank.build()
.then(data => {
const levelattachment = new Discord.MessageAttachment(data, 'funny.png')
message.channel.send({attachments:[levelattachment]});
})
}
}
const fetch = require('node-fetch');
const Discord = require('discord.js');
module.exports = {
name: "covid",
catagory: "Statistics",
description: "Track a country or worldwide COVID-19 cases",
async execute (client, message, args){
let countries = args.join(" ");
const noArgs = new Discord.MessageEmbed()
.setTitle('Missing Country...')
.setColor("#AF8181")
.setDescription('You are missing the identifier after the "y!covid" (ex: y!covid all || y!covid USA)')
.setTimestamp()
if(!args[0]) return message.channel.send({embeds:[noArgs]});
if(args[0] === "all"){
fetch(`https://covid19.mathdro.id/api`)
.then(response => response.json())
.then(data => {
let confirmed = data.confirmed.value.toLocaleString()
let recovered = data.recovered.value.toLocaleString()
let deaths = data.deaths.value.toLocaleString()
const worldcovidbed = new Discord.MessageEmbed()
.setTitle(`Worldwide COVID-19 Stats `)
.setThumbnail("https://cms.accuweather.com/wp-content/uploads/2020/03/CoronavirusAnimation2.gif")
.addField('Confirmed Cases', confirmed)
.addField('Recovered', recovered)
.addField('Deaths', deaths)
.setTimestamp()
.setColor("#AF8181")
message.channel.send({embeds:[worldcovidbed]});
})
} else {
fetch(`https://covid19.mathdro.id/api/countries/${countries}`)
.then(response => response.json())
.then(data => {
let confirmed = data.confirmed.value.toLocaleString()
let recovered = data.recovered.value.toLocaleString()
let deaths = data.deaths.value.toLocaleString()
const countrybed = new Discord.MessageEmbed()
.setTitle(`COVID-19 Statistics for **${countries}**`)
.setThumbnail("https://cdn.discordapp.com/attachments/873580831803846720/875811056637861938/covidpic-removebg-preview.png")
.addField('Confirmed Cases', confirmed)
.addField('Recovered', recovered)
.addField('Deaths', deaths)
message.channel.send({embeds:[countrybed]})
}).catch(e => {
return message.channel.send('The country provided does not exist! :open_mouth: ')
})
}
}
}
{name:"Link", value:`[${channel.body.items[0].snippet.channelTitle}](https://www.youtube.com/channel/${channel.body.items[0].id.channelId})`,inline: true},