#Xd chat commands are just more messy

1 messages · Page 1 of 1 (latest)

tepid zephyr
#

You see we humans kind of expect people not to be stupid and don't really test too many things lol

noble grove
#

Ah then it's me that was just a psycho

tepid zephyr
#

so far

noble grove
#

And insanely precisely wanted things to be done the way I want them xd

tepid zephyr
#

all my commands have a very good parameter

noble grove
#

Nice

#

Slash gives a list tho

tepid zephyr
#

if(!message.member.permissions.has(Permissions.FLAGS.ADMINISTRATOR))return message.reply ('❌You do not have the permissions to perform this command!')

noble grove
#

And perms are much easier to set

tepid zephyr
#

that is from my v13 bots

#

slash commands is gonna be one of those things that someone shows me exactly how to do it and I will just be able to do anything with it

noble grove
#

Yea

#

I could

#

If I was home

#

Although I don't use the buklders

#

I use json formatted

tepid zephyr
#

like i have a friend who is familiar with discord.js

noble grove
#

Which is not very intuitive for most

tepid zephyr
#

i was a little familiar with js in general

#

but i know most things are a google search

noble grove
#

Yeas

tepid zephyr
#

@noble grove hey i made the command yeah finally, 2 things even if i have a check for the data it tries to create the command every time i run the bot

#

and it doesnt trigger my event

#
async function commands() {
    const guild = george.guilds.cache.get(config.guild);
    const checked = george.application.commands.fetch()
    const commands = ({
        name: 'status',
        description: 'Display Server Status',})
    if(checked != commands) {
    george.application.commands.create(commands)
console.log("f")}
}```
#

the code

noble grove
#

Hmm I wouldn't use the event they were talking about

#

I just push when I know there's a change

#

But I'm the only dev

#

And I hate having shit like that automated

tepid zephyr
#

by the event i mean interactionCreate

noble grove
#

Oh xd

tepid zephyr
#

it doesnt trigger my command in there

noble grove
#

You can type the command in the server?

tepid zephyr
#

yess

noble grove
#

Idk how the builders work

#

Cus I only use interactioncreate

tepid zephyr
#

i am good to go with creating etc

#

but my command doesnt run

#
george.on('interactionCreate', async interaction =>{
    const guild = george.guilds.cache.get(config.guild);
    if(interaction.isCommand()) {
        if(interaction.customid === 'status') {```
#

is this v13 cuz i kinda didnt study the changes lmao

noble grove
#

Slash commands don't have a customid

#

They have a name

tepid zephyr
#

oh.

#

ohhhhh

noble grove
#

Xd

#

And iscommand idk if it works

tepid zephyr
#

retry moment

noble grove
#

Just check for the type

#

Interaction.type

#

Throw a switch case in there

tepid zephyr
#

switch case?

simple obsidianBOT
#

mdn switch
The switch statement evaluates an expression, matching the expression's value against a series of case clauses, and executes statements after the first case clause with a matching value, until a break statement is encountered. The default clause of a switch statement will be jumped to if no case matches the expression's value.

tepid zephyr
#

-interaction.isCommand();
+interaction.type === InteractionType.ApplicationCommand;

#

it was changed true

noble grove
#

Yey

tepid zephyr
#

question

#

how can i add cooldowns to this

#

is there something built in?

noble grove
#

Nope

#

Settimeout

#

Is what you can use

#

Add userid to an array, settimeout for x seconds then remove userid from array

#

If the command is executed see if the userid is in the array, if yes then tell them to go fuck themselves

tepid zephyr
#

hmh

#

it still didnt respond

#
george.on('interactionCreate', async interaction =>{
    const guild = george.guilds.cache.get(config.guild);
    if(interaction.type === InteractionType.ApplicationCommand) {
        if(interaction.name === 'status') {```
noble grove
#

Log immediately at the top of interactioncreate

tepid zephyr
#

truering

#

anything after the name doesnt run

#
george.on('interactionCreate', async interaction =>{
    console.log("yes1")
    const guild = george.guilds.cache.get(config.guild)
    if(interaction.type === InteractionType.ApplicationCommand) {
        console.log("yes2")
        if(interaction.name === 'status') {
            console.log("yes3")```
#

i usually use the word gay but i think people in here wouldn't appreciate that so it has to be yes this time

noble grove
#

Is the name status

tepid zephyr
#

yeah

noble grove
tepid zephyr
#

undefined

#

what in the world

noble grove
#

And it's a slash command?

#

Log interaction then

#

Xd

#

Let's see

tepid zephyr
#

what the hell

#
ChatInputCommandInteraction {
  type: 2,
  id: '1009392116629245982',
  applicationId: '1007949647991550032',
  channelId: '1009022231906631690',
  guildId: '1006535868858781706',
  user: User {
    id: '177083022305263616',
    bot: false,
    system: false,
    flags: UserFlagsBitField { bitfield: 256 },
    username: 'George',
    discriminator: '6242',
    avatar: '4ee1d5f278a36a61aa9164b9263c8722',
    banner: undefined,
    accentColor: undefined
  },
  member: GuildMember {
    guild: Guild {
      id: '1006535868858781706',
      name: 'George Roleplay Template',
      icon: null,
      features: [],
      commands: [GuildApplicationCommandManager],
      members: [GuildMemberManager],
      channels: [GuildChannelManager],
      bans: [GuildBanManager],
      roles: [RoleManager],
      presences: PresenceManager {},
      voiceStates: [VoiceStateManager],
      stageInstances: [StageInstanceManager],
      invites: [GuildInviteManager],
      scheduledEvents: [GuildScheduledEventManager],
      available: true,
      shardId: 0,
      splash: null,
      banner: null,
      description: null,
      verificationLevel: 0,
      vanityURLCode: null,
      nsfwLevel: 0,
      premiumSubscriptionCount: 0,
      discoverySplash: null,
      memberCount: 2,
      large: false,
      premiumProgressBarEnabled: false,
      applicationId: null,
      afkTimeout: 300,
      afkChannelId: null,
      systemChannelId: null,
      premiumTier: 0,
      explicitContentFilter: 0,
      mfaLevel: 0,
      joinedTimestamp: 1660385434429,
      defaultMessageNotifications: 0,
      systemChannelFlags: [SystemChannelFlagsBitField],
      maximumMembers: 500000,
      maximumPresences: null,
      maxVideoChannelUsers: 25,
      approximateMemberCount: null,
      approximatePresenceCount: null,
      vanityURLUses: null,
      rulesChannelId: null,
      publicUpdatesChannelId: null,
      preferredLocale: 'en-US',
      ownerId: '177083022305263616',
      emojis: [GuildEmojiManager],
      stickers: [GuildStickerManager]
    },
    joinedTimestamp: 1660047251678,
    premiumSinceTimestamp: null,
    nickname: null,
    pending: false,
    communicationDisabledUntilTimestamp: null,
    _roles: [],
    user: User {
      id: '177083022305263616',
      bot: false,
      system: false,
      flags: [UserFlagsBitField],
      username: 'George',
      discriminator: '6242',
      avatar: '4ee1d5f278a36a61aa9164b9263c8722',
      banner: undefined,
      accentColor: undefined
    },
    avatar: null
  },
  version: 1,
  appPermissions: PermissionsBitField { bitfield: 4398046511103n },
  memberPermissions: PermissionsBitField { bitfield: 4398046511103n },
  locale: 'en-GB',
  guildLocale: 'en-US',
  commandId: '1009387579545751632',
  commandName: 'status',
  commandType: 1,
  commandGuildId: null,
  deferred: false,
  replied: false,
  ephemeral: null,
  webhook: InteractionWebhook { id: '1007949647991550032' },
  options: CommandInteractionOptionResolver {
    _group: null,
    _subcommand: null,
    _hoistedOptions: []
  }
}```
#

noice.

#

chatinputcommandinteraction

noble grove
#

Hm