#BulkOverwrite has stopped functioning

1 messages · Page 1 of 1 (latest)

tidal quartz
#

In the last 5 months have there been any breaking changes to how commands register? I created 2 sapphirecli slash commands and one has appeared after several days (roll), the other one (createchannel) was pushed 2 hours ago and has not shown up in the BulkOverwritten guild yet.

lyric steppeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

tidal quartz
#
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
import { CategoryChannel, ChannelType } from 'discord.js';

@ApplyOptions<Command.Options>({
    name: 'createchannel',
    description: 'debug command to create a channel'
})
export class UserCommand extends Command {
    public override registerApplicationCommands(registry: Command.Registry) {
        registry.registerChatInputCommand((builder) =>
            builder //
                .setName(this.name)
                .setDescription(this.description)
                .addStringOption((option) =>
                    option //
                        .setName('name')
                        .setDescription('The name of the channel')
                        .setRequired(true)
                )
                .addIntegerOption((option) =>
                    option //
                        .setName('categoryID')
                        .setDescription('The category ID to place the channel under')
                        .setRequired(true)
                )
        );
    } ........
#
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';

@ApplyOptions<Command.Options>({
    // name: 'roll',
    description: 'Roll an n-sided die m times and return the results.'
})
export class UserCommand extends Command {
    public override registerApplicationCommands(registry: Command.Registry) {
        registry.registerChatInputCommand((builder) =>
            builder //
                .setName(this.name)
                .setDescription(this.description)
                .addIntegerOption((option) =>
                    option //
                        .setName('sides')
                        .setDescription('The number of sides on the dice')
                        .setRequired(true)
                )
                .addIntegerOption((option) =>
                    option //
                        .setName('rolls')
                        .setDescription('The number of times to roll the dice')
                        .setRequired(false)
                )
        );
    }...........```
#
ApplicationCommandRegistries.setDefaultGuildIds(['925192180480491540']);
ApplicationCommandRegistries.setDefaultBehaviorWhenNotIdentical(RegisterBehavior.BulkOverwrite);```
#

in index.ts

#

also added these to lib/setup.ts ts import '@sapphire/plugin-logger/register'; import '@sapphire/plugin-api/register'; import '@sapphire/plugin-editable-commands/register'; import '@sapphire/plugin-subcommands/register';

storm ingot
#

make sure you're compiling your TS code

#

and clean dist to be sure

tidal quartz
storm ingot
#

it wouldnt, but make sure that your docker builds are working and not failing during build

tidal quartz
storm ingot
#

so is the pipeline green?

tidal quartz
#

yes sir it is

#

one second

tidal quartz
storm ingot
#

Can you try setting the default behaviour to overwrite instead of bulk?

#

I can't recall what it was, would have to search this forum, but there was a weird bug with bulk before

#

Maybe if you search this channel for BulkOverwrite you can find that thread again

tidal quartz
#

I can try it again though and leave it for a few hours

storm ingot
#

commands should always register instantly

#

waiting a few hours does nothing

#

that's something of way back in the day only

tidal quartz
#

oh. I’ll try it again and see if it randomly works this time

tidal quartz
tidal quartz
#

has to be something wrong with my code 🙄 still not appeared overnight

storm ingot
#

@royal pawn thy hath been summoned

royal pawn
#

huh

#

which cmd doesnt show up

tidal quartz
#

CreateChannel

#

I think I may have just figured it out, but im veryifying rq

#

I think I might be deleting/creating my container incorrectly, is this not enough to update a running container?

royal pawn
#

you're doing What

tidal quartz
#
docker stop Lyra &&\
echo "Deleting container..." &&\
docker rm Lyra &&\
echo "Creating container..." &&\
docker run\
  -d\
  --name='Lyra'\
  --net='bridge'\
  -e TZ="America/Chicago"\
  -e HOST_OS="Unraid"\
  -e HOST_HOSTNAME="Moonlink"\
  -e HOST_CONTAINERNAME="Lyra"\
  -e 'DISCORD_TOKEN'='token'\
  -l net.unraid.docker.managed=dockerman\
  -l net.unraid.docker.icon='.cx/s/kYF27nN29wBnMoD/preview' 'ghcr.io/masonbesmer/lyra-sapphire:latest' &&\
echo "Removing dangling images..." &&\
docker image prune -f &&\
echo "Finished" &&\
exit 0```
royal pawn
#

oh

storm ingot
#

this is why you use docker compose 👀

tidal quartz
storm ingot
#
docker compose pull <service>
docker compose up -d --force-recreate --no-deps <service

done

tidal quartz
#

is it perchance a dropin replacement?

storm ingot
#

no you need to write a compose file

#

but you'd do well to do that

royal pawn
#

btw ithink the issue is your categoryID option, idk if it can have upper case letters

#

but it should log to the console....

#

do you have any listeners for CommandApplicationCommandRegistryError?

storm ingot
#

I have this as control.sh (which in turn is added to PATH) on my linux machines

#!/usr/bin/zsh

RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
WORKSPACE_DIR="$HOME/workspace"

alias dc="docker compose"

# Display a message, wrapping lines at the terminal width.
message() {
    printf "$1 \n"
}

function removeAllContainers() {
    docker ps -a -q | xargs --no-run-if-empty docker rm -fv
}

help() {
    message "\n${BLUE}Infi Docker Control script${NC}

    ${GREEN}Usage:${NC}\n
        control [COMMAND] [ARGS...]
        control -h | --help

    ${YELLOW}Commands:${NC}\n
        build           Builds a Docker image so it is prepped for running
        start           Starts a Docker container in detached state
        stop            Stops a Docker container
        remove          Removes a single Docker container
        removeall       Removes all Docker containers
        logs            Shows the logs of a Docker container
        tail            Tails the logs of a Docker container
        update          Updates a running container"
}

case $1 in
build) dc -f ${WORKSPACE_DIR}/docker-compose.yml build ${@:2:99} ;;
start) dc -f ${WORKSPACE_DIR}/docker-compose.yml up -d --no-deps ${@:2:99} ;;
restart) dc -f ${WORKSPACE_DIR}/docker-compose.yml restart ${@:2:99} ;;
recreate) dc -f ${WORKSPACE_DIR}/docker-compose.yml up -d --no-deps --force-recreate ${@:2:99} ;;
stop) dc -f ${WORKSPACE_DIR}/docker-compose.yml stop ${@:2:99} ;;
logs) dc -f ${WORKSPACE_DIR}/docker-compose.yml logs -t --tail=100 ${@:2:99} ;;
tail) dc -f ${WORKSPACE_DIR}/docker-compose.yml logs -tf --tail=100 ${@:2:99} ;;
remove) dc -f ${WORKSPACE_DIR}/docker-compose.yml rm -fsv ${@:2:99} ;;
removeall) removeAllContainers ;;
update) dc -f ${WORKSPACE_DIR}/docker-compose.yml pull ${@:2:99} && dc -f ${WORKSPACE_DIR}/docker-compose.yml up -d --no-deps --force-recreate ${@:2:99} ;;
redis) docker compose -f ${WORKSPACE_DIR}/docker-compose.yml exec redis redis-cli -p ${REDIS_PORT} -a $(cat ${WORKSPACE_DIR}/redis-pass) ;;
*) help ;;
esac
#

so I just run control update <service> and boom it updates

royal pawn
#

I could also use the logs from when you started the bot when it was running with VerboseOverwrite

tidal quartz
#

it appears that was the only issue though

#

I have fixed the command temporarily and it now functions properly

#

root cause analysis: PICNIC

lyric steppeBOT
storm ingot
#

PICNIC?

#

I mean I know what a picnic is but I've never heard it used as abbreviation

tidal quartz
storm ingot
#

oohhh

tidal quartz
storm ingot
#

I do a mix. On the repo is a compose file but it's meant for Dev. The prod server has a separate one because it has env vars for credentials and such.

#

That prod one we backup periodically by gzipping it together with some other files and actually tonight I'm going to explore the new feature of EaseUS Todo Backup free that can auto sync over SFTP (3-2-1 backups)