#BulkOverwrite has stopped functioning
1 messages · Page 1 of 1 (latest)
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';
no if there would be a new semver major version of sapphire would've been published. Semver doesn't allow breaking changes in patch or minor versions.
make sure you're compiling your TS code
and clean dist to be sure
hmm would this still apply given that it’s a docker image that is recreated every commit and deleted/pulled every time? no volumes either
it wouldnt, but make sure that your docker builds are working and not failing during build
don’t think they are, I have it set up through GH actions and it wouldn’t pass the pipeline unless it succeeded
so is the pipeline green?
Any other ideas @storm ingot ? It still hasn’t shown up which is making me think it’s my code.. https://github.com/masonbesmer/lyra-sapphire/blob/main/src/commands/CreateChannel.ts
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
I think I tried that already but I only gave it 10 or so minutes to update and it hadn’t: https://github.com/masonbesmer/lyra-sapphire/commit/6ef2e6dea65c38f883cfdc09de0110cadcf219cf
I can try it again though and leave it for a few hours
commands should always register instantly
waiting a few hours does nothing
that's something of way back in the day only
oh. I’ll try it again and see if it randomly works this time
Good to know though
has to be something wrong with my code 🙄 still not appeared overnight
@royal pawn thy hath been summoned
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?
you're doing What
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```
oh
this is why you use docker compose 👀

docker compose pull <service>
docker compose up -d --force-recreate --no-deps <service
done
is it perchance a dropin replacement?
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?
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
I could also use the logs from when you started the bot when it was running with VerboseOverwrite
yes, that is what caused me to think it was my deployment method, because when i forcefully updated the container, it started showing that error
it appears that was the only issue though
I have fixed the command temporarily and it now functions properly
root cause analysis: PICNIC
now this is nice
Thank you for marking this question as solved!
Problem In Chair, Not In Computer
oohhh
got a very, very noob question for you: do I push my docker-compose.yml to my git repo and let it be built in to the image, or do i only put it on my production server? I'm not exactly 100% sure how compose works
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)