Open JBraunsmaJr opened 2 years ago
@JBraunsmaJr I can pick this up and while setting up in local, I tried to start the API which is the entry point, and it is causing a couple of below issues, can you please put the dependent services to start and a few more detailed steps to debug in local.
Ah, fair point I'll add that to setup
You will need to grab a discord token from the discord developer portal. This will be for local testing. https://discord.com/developers/applications
IDK which IDE you're using, but if you CD into your project directory via command line you can set the token via
dotnet user-secrets set "CodeJamBot:Discord:Token" "yourtokenhere"
What this does is stores the token outside of source control thus making it safe to use... prevents accidentally leaking API keys and what not. If you accidently commit it on a public repo Discord auto-revokes that token forcing you to get a new token
Ok got it, Thank you
https://github.com/Programming-Simplified-Community/CommunityBot/blob/main/Docs/TOC.md
Have been adding to our documentation. Just added some notes on database
I created an application in the discord developer portal with a BOT, added admin privileges to the bot, and stored the token to the secrets but still, I am getting "Discord.Net.WebSocketClosedException: The server sent close 4014: "Disallowed intent(s)." Am I missing any other settings while running the API, able to set up the DB
In the portal, for your bot try enabling members intents. Then try again?
Updated and it got connected but getting the below error now.
CodeJam.Services.CodeJamBot[0] Connected fail: CodeJam.Services.CodeJamBot[0] An error occurred while initializing bot: Discord.Net.HttpException: The server responded with error 50001: Missing Access at Discord.Net.Queue.RequestBucket.SendAsync(RestRequest request) at Discord.Net.Queue.RequestQueue.SendAsync(RestRequest request) at Discord.API.DiscordRestApiClient.SendInternalAsync(String method, String endpoint, RestRequest request) at Discord.API.DiscordRestApiClient.SendJsonAsync[TResponse](String method, String endpoint, Object payload, BucketId bucketId, ClientBucketType clientBucket, RequestOptions options) at Discord.API.DiscordRestApiClient.BulkOverwriteGuildApplicationCommandsAsync(UInt64 guildId, CreateApplicationCommandParams[] commands, RequestOptions options) at Discord.Rest.InteractionHelper.BulkOverwriteGuildCommandsAsync(BaseDiscordClient client, UInt64 guildId, ApplicationCommandProperties[] args, RequestOptions options) at Discord.Rest.ClientHelper.BulkOverwriteGuildApplicationCommandAsync(BaseDiscordClient client, UInt64 guildId, ApplicationCommandProperties[] properties, RequestOptions options) at Discord.Interactions.InteractionService.RegisterCommandsToGuildAsync(UInt64 guildId, Boolean deleteMissing) at CodeJam.Services.CodeJamBot.ReadyAsync() in \CodeJamBot.cs:line 246
Ah. Inside appsettings.json the primary guild Id needs to be your test server. Can right click on your server icon from list of servers to select copy ID.
Similarly the channel IDs can be done the same way. Role ID is the ID of role to assign people when they want to join the codejam.
Not the ideal route. Guild ID is fine but channel and role I feel should be dynamically fetched via name, and created if not found. Haven't gotten around to finding the right call for it in the Discord.NET api.
When user invokes the
change-name
command they should automatically be casted foryes
instead of being forced to vote yes on their own suggestion.