Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAM Command #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

IAM Command #4

wants to merge 4 commits into from

Conversation

Jack41784090
Copy link
Contributor

No description provided.

@modernNeo
Copy link
Member

please clean up that commit history. there's just waaay too many commits for one command and there should be not commits from me on there.

If you don't know how to do that. I suggest making a new branch called add_iam_command where you can have 1 commit which has only 1 commit with the necessary commits for the iam command

@Jack41784090
Copy link
Contributor Author

@modernNeo Got it done, Jace


public override async registerApplicationCommands(registry: ChatInputCommand.Registry) {
// this.logger is a customised Winston Logger. It logs onto the console and onto Winston (file system) at the same time.
this.logger = (new EveLogger('iam')).cmd_logger;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are missing alot of code in this function that I put into the other commands in EVE to ensure each launch of the bot results in a fresh update of al the commands, specifically ApplicationCommandRegistry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newest commit addresses this problem


// 3. Get roles, and then assign.
const roles = await interaction.guild.roles.fetch();
const selected_role = roles.find(r => r.name === course);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you test this code?

I got this error
Screenshot from 2024-02-24 17-12-39

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newest commit addresses this problem

const fc = interaction.options.getFocused(true);
const roles = await interaction.guild.roles.fetch()
const rgx = /^[a-z]/g
const all_roles = Array.from(roles.values())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you forgot to ensure that you don't return roles a user already has....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newest commit addresses this problem

@Jack41784090
Copy link
Contributor Author

Something might be wrong with how the token is set up in CI. Can you look this up?

@Jack41784090
Copy link
Contributor Author

Jack41784090 commented Feb 25, 2024

Also, can you explain how this code block works?

let opt  : ApplicationCommandRegistryRegisterOptions = new class implements ApplicationCommandRegistry.RegisterOptions {
	behaviorWhenNotIdentical: Exclude<RegisterBehavior, RegisterBehavior.BulkOverwrite>;
	guildIds: string[];
	idHints: string[];
	registerCommandIfMissing: boolean;
}
opt.guildIds = [process.env.GUILD_ID]

@modernNeo
Copy link
Member

do

git remote add upstream https://github.com/CSSS/eve.git
git fetch upstream
git pull --rebase upstream master

to solve the CI issues

@modernNeo
Copy link
Member

Also, can you explain how this code block works?

let opt  : ApplicationCommandRegistryRegisterOptions = new class implements ApplicationCommandRegistry.RegisterOptions {
	behaviorWhenNotIdentical: Exclude<RegisterBehavior, RegisterBehavior.BulkOverwrite>;
	guildIds: string[];
	idHints: string[];
	registerCommandIfMissing: boolean;
}
opt.guildIds = [process.env.GUILD_ID]

it seems to be the only way via Sapphire to ensure the latest slash command callbacks and interaction auto-completes are fully re-synced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants