-
Notifications
You must be signed in to change notification settings - Fork 65
Developers
Below is a guide on how to start developing Modix. Depending on the nature of the features you want to add/work on, there's a few different workflows you might want to use, each of which have different requirements.
To work on Modix, you need a few things:
- A Discord bot set up - go here to create one, add a bot to it, and copy the token from the page. You can then add the bot to your server by going to
https://discordapp.com/oauth2/authorize?scope=bot&permissions=0&client_id=[ID HERE]
, replacing[ID HERE]
with the Client ID of your bot (not the token). - Under
https://discordapp.com/developers/applications/{CLIENT ID HERE}/oauth
make sure to add redirect to your domain such ashttp://localhost:5000/signin-discord
and make sure it is appended with/signin-discord
- The latest .NET Core SDK for your chosen platform (currently 2.1.402)
- PostgreSQL database server. A docker container also works.
- Optional: Docker (if you need to make sure you don't break CI). If you're on Windows, make sure you switch to Linux containers.
If you're working on a feature that involves Modix's core services, and only needs to work with the Discord bot frontend, then you can do all your development with your C# IDE of choice by opening Modix.sln
. First, make sure you have some environment variables set, either through your Project properties -> Debug tab, or however you prefer.
-
Required
-
MODIX_DB_CONNECTION
- this is the connection string to your PostgreSQL instance. When developing locally, it'll probably be easiest to run Postgres in a container, or install it onto your development OS - whatever works. A simple connection string looks like:Server=127.0.0.1;Port=5432;Database=myDataBase;User Id=myUsername;Password=myPassword;
-
DiscordToken
- this is the bot token Modix should use to connect to the Discord API. See above.
-
-
Optional
-
DiscordClientId
- also taken from the Discord API page for your bot, this is needed for the web frontend's OAuth stuff to work properly. Can be ignored if you aren't working on/with the web frontend. -
DiscordClientSecret
- same as above. -
DiscordMessageCacheSize
- An integer value defining the internal Discord.Net message cache size - used for logging deleted messages. Should be around 10 or more, but you don't need it unless you're testing message deletion. -
log_webhook_id
- The ID of the Discord webhook to log to. Only necessary if you want log messages to appear in a channel on the server.https://discordapp.com/api/webhooks/[this part]/asda2ed2klkm5lkn42n34jk
-
log_webhook_token
- Same as above, but the token of the webhook.https://discordapp.com/api/webhooks/000000000000000000/[this part]
-
SentryToken
- The token to a Sentry server, for external logging -
ReplToken
- The token for the REPL service, if you want to use it -
StackoverflowToken
- A token for the StackOverflow API, if you need to use the StackOverflow module
-
After setting all this up, you can move on to learning about how modix starts!
If you encounter anything confusing about the MODiX codebase, have a look at Application Architecture, or just hop into #modix-development and ask us directly.