This repository has been archived by the owner on Oct 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
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 #54 from Sparkbots/Development
V0.1.0-beta 1
- Loading branch information
Showing
11 changed files
with
309 additions
and
219 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,10 +1,31 @@ | ||
language: node_js | ||
node_js: | ||
- "7" | ||
- "8" | ||
- "9" | ||
|
||
install: npm install | ||
script: node app | ||
jobs: | ||
include: | ||
- stage: ESLint | ||
node_js: "8" | ||
script: npm test | ||
- stage: Mocha | ||
node_js: "8" | ||
script: npm run mocha-test | ||
|
||
matrix: | ||
allow_failures: | ||
- node_js: "7" | ||
|
||
notifications: | ||
webhooks: | ||
urls: | ||
- https://api.discordspark.com/travis | ||
on_success: always | ||
on_failure: always | ||
on_start: always | ||
on_cancel: always | ||
on_error: always | ||
email: false |
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 |
---|---|---|
@@ -1,52 +1,52 @@ | ||
var Spark = require("../") | ||
const Command = Spark.command("about") | ||
const embed = new Spark.methods.RichEmbed(); | ||
|
||
Command.setLevel(0) | ||
Command.setDescription("Get information about this bot.") | ||
|
||
Command.code = async (client, message) => { | ||
|
||
var v = process.memoryUsage().heapUsed | ||
v = (v/1024/1024).toFixed(3); | ||
v = (v / 1024 / 1024).toFixed(3); | ||
|
||
var prefixText = prefixList().map(i => i).join(", ") | ||
if (prefixList().length > 1){ | ||
prefixText = prefixList().map(i => ("`" + i + "`")).join(", ") | ||
var prefixText = prefixList().map(i => i).join(", ") | ||
if (prefixList().length > 1) { | ||
prefixText = prefixList().map(i => ("`" + i + "`")).join(", ") | ||
} | ||
if (message.channel.permissionsFor(message.guild.members.get(client.user.id)).serialize().EMBED_LINKS) { | ||
embed.setTitle(`Information about ${client.user.username}`) | ||
embed.setDescription(`Hello, I am ${client.user.tag}. I am owned and maintained by <@${client.config.ownerID}>, created with the Discord.JS framework known as **Spark**.\n\n`+ | ||
"Spark is a powerful modular framework that makes creating Discord bots easy.") | ||
embed.addField("Prefix(es):", prefixText, true) | ||
embed.addField("Servers:", client.guilds.size, true) | ||
embed.addField("Users:", client.users.size, true) | ||
embed.addField("Memory Usage:", `${v} MB`, false) | ||
embed.addField("Spark Version:", Spark.version, false) | ||
embed.addField("More Information:", "Feel free to visit our [website](https://discordspark.com) or our discord [server](https://discord.gg/TezD2Zg) for more information about the Spark Framework.", false) | ||
embed.setFooter("Made with Spark") | ||
embed.setTimestamp() | ||
embed.setColor(0xe1e818) | ||
return message.channel.send("", {embed}) | ||
const embed = new Spark.methods.RichEmbed(); | ||
embed.setTitle(`Information about ${client.user.username}`) | ||
embed.setDescription(`Hello, I am ${client.user.tag}. I am owned and maintained by <@${client.config.ownerID}>, created with the Discord.JS framework known as **Spark**.\n\n` + | ||
"Spark is a powerful modular framework that makes creating Discord bots easy.") | ||
embed.addField("Prefix(es):", prefixText, true) | ||
embed.addField("Servers:", client.guilds.size, true) | ||
embed.addField("Users:", client.users.size, true) | ||
embed.addField("Memory Usage:", `${v} MB`, false) | ||
embed.addField("Spark Version:", Spark.version, false) | ||
embed.addField("More Information:", "Feel free to visit our [website](https://discordspark.com) or our discord [server](https://discord.gg/TezD2Zg) for more information about the Spark Framework.", false) | ||
embed.setFooter("Made with Spark") | ||
embed.setTimestamp() | ||
embed.setColor(0xe1e818) | ||
return message.channel.send("", {embed}) | ||
} | ||
var owner = await client.fetchUser(client.config.ownerID); | ||
message.channel.send(`Hello, I am ${client.user.tag}. I am owned and maintained by ${owner.tag}, created with the Discord.JS framework known as **Spark**.\n\n`+ | ||
"Spark is a powerful modular framework that makes creating Discord bots easy.\n\n" + | ||
`My prefix(es) are: ${prefixText}.\n`+ | ||
// "My ping is: {bot_latency}ms.\n"+ | ||
`I am running on version \`${Spark.version}\` of spark.\n\n`+ | ||
"__Statistics__\n"+ | ||
`I am currently in \`${client.guilds.size}\` servers.\n`+ | ||
`I am being used by \`${client.users.size}\` users.\n`+ | ||
`I am using \`${v}\` MB of memory.\n\n`+ | ||
"For more information about the **Spark** framework visit https://discord.gg/TezD2Zg or the website https://discordspark.com") | ||
message.channel.send(`Hello, I am ${client.user.tag}. I am owned and maintained by ${owner.tag}, created with the Discord.JS framework known as **Spark**.\n\n` + | ||
"Spark is a powerful modular framework that makes creating Discord bots easy.\n\n" + | ||
`My prefix(es) are: ${prefixText}.\n` + | ||
// "My ping is: {bot_latency}ms.\n"+ | ||
`I am running on version \`${Spark.version}\` of spark.\n\n` + | ||
"__Statistics__\n" + | ||
`I am currently in \`${client.guilds.size}\` servers.\n` + | ||
`I am being used by \`${client.users.size}\` users.\n` + | ||
`I am using \`${v}\` MB of memory.\n\n` + | ||
"For more information about the **Spark** framework visit https://discord.gg/TezD2Zg or the website https://discordspark.com") | ||
|
||
function prefixList() { | ||
if (client.customConfig.get(message.guild.id).prefix) { | ||
return client.customConfig.get(message.guild.id).prefix | ||
} | ||
return client.config.prefix | ||
} | ||
if (client.customConfig.get(message.guild.id).prefix) { | ||
return client.customConfig.get(message.guild.id).prefix | ||
} | ||
return client.config.prefix | ||
} | ||
|
||
} | ||
module.exports = Command; |
Oops, something went wrong.