mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
new invite display
This commit is contained in:
parent
9fa0fb1ee4
commit
115a9fe9ea
2 changed files with 14 additions and 5 deletions
|
@ -1,7 +1,9 @@
|
||||||
|
const { DISCORD_INVITES } = require("../../../labscore/constants");
|
||||||
const { createEmbed } = require("../../../labscore/utils/embed");
|
const { createEmbed } = require("../../../labscore/utils/embed");
|
||||||
const { guildFeaturesField } = require("../../../labscore/utils/fields");
|
const { guildFeaturesField } = require("../../../labscore/utils/fields");
|
||||||
const { icon, highlight, timestamp } = require("../../../labscore/utils/markdown");
|
const { icon, highlight, timestamp, link } = require("../../../labscore/utils/markdown");
|
||||||
const { editOrReply } = require("../../../labscore/utils/message");
|
const { editOrReply } = require("../../../labscore/utils/message");
|
||||||
|
const { STATICS } = require("../../../labscore/utils/statics");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'invite',
|
name: 'invite',
|
||||||
|
@ -16,9 +18,12 @@ module.exports = {
|
||||||
},
|
},
|
||||||
run: async (context, args) => {
|
run: async (context, args) => {
|
||||||
context.triggerTyping();
|
context.triggerTyping();
|
||||||
if(!args.invite) return editOrReply(context, createEmbed("default", context, {
|
if(!args.invite) return editOrReply(context, { content: `https://canary.discord.com/application-directory/${context.client.user.id}`, embed:createEmbed("default", context, {
|
||||||
description: icon("link") + " You can invite the bot with [this](https://discord.com/api/oauth2/authorize?client_id=682654466453012553&permissions=412317247552&scope=bot%20applications.commands) link."
|
description: `${icon("link")} You can invite the bot with ${link(context.application.oauth2UrlFormat({ scope: 'bot applications.commands', permissions: 412317247552 }), 'this')}\n\n${icon('robouser')} Join our ${link(DISCORD_INVITES.support, "support server")} if you need help with anything!`,
|
||||||
}))
|
image: {
|
||||||
|
url: STATICS.embedSpacerInvite
|
||||||
|
}
|
||||||
|
})})
|
||||||
try{
|
try{
|
||||||
const inviteCode = args.invite.match(/(?:(?:https|http):\/\/)?(?:(?:discord.gg|(?:discord|discordapp)\.com\/invite)\/)?([A-z0-z-]{2,32})/)
|
const inviteCode = args.invite.match(/(?:(?:https|http):\/\/)?(?:(?:discord.gg|(?:discord|discordapp)\.com\/invite)\/)?([A-z0-z-]{2,32})/)
|
||||||
const invite = await context.client.rest.fetchInvite(inviteCode[1], {withCounts: true})
|
const invite = await context.client.rest.fetchInvite(inviteCode[1], {withCounts: true})
|
||||||
|
|
|
@ -109,7 +109,11 @@ module.exports.STATICS = Object.freeze({
|
||||||
urbandictionary: staticAsset(Statics.brands.urbandictionary),
|
urbandictionary: staticAsset(Statics.brands.urbandictionary),
|
||||||
wikihow: staticAsset(Statics.brands.wikihow),
|
wikihow: staticAsset(Statics.brands.wikihow),
|
||||||
wolframalpha: staticAsset(Statics.brands.wolframalpha),
|
wolframalpha: staticAsset(Statics.brands.wolframalpha),
|
||||||
youtube: staticAsset(Statics.brands.youtube)
|
youtube: staticAsset(Statics.brands.youtube),
|
||||||
|
embedSpacerInvite: staticAsset({
|
||||||
|
file: "misc/embed-spacer-botinvite.png",
|
||||||
|
revision: 0
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
module.exports.STATIC_ICONS = Object.freeze({
|
module.exports.STATIC_ICONS = Object.freeze({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue