I know this is a rather old post, but I do know the answer and since it's the top most google search result, I figure this could still be helpful for people in the future.
About .NET Core
I created my C# discord bot in visual studio 2017 as a .NET Core project. .NET Core works similar to java, where your program doesn't get run by the OS directly, but rather by a program that is run on the OS. This makes it so that your code is platform independent and you can use your same code on both Linux and Windows for example, as long as your OS has the .NET Core runtime installed.
I installed the Discord.Net package using nuGet in visual studio in my project as my interface with the discord API. Discord.Net is compatible with .NET Core and therefore we can easily port it to the raspberry pi.
Getting your bot to run on the raspberry
DISCLAIMER: I used a raspberry running Raspbian, so I know it works on that, but I don't know if this works on systems that run on a different OS.
First you need to get the .NET Core runtime on your raspberry. I used the tutorial on this website to install .NET Core 2.0 on my raspberry. You connect to the raspberry using putty and follow the steps in that article as follows:
sudo apt-get install curl libunwind8 gettext to install all dependencies
curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/dotnet-runtime-latest-linux-arm.tar.gz to download the 2.0.0 release of the dotnet runtime
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet to create a folder for the runtime and extract it.
sudo ln -s /opt/dotnet/dotnet /usr/local/bin to create a symbolic link
The second step is to set up the environment on your computer to send your programs to the raspberry. I used this website to do that. Assuming you use visual studio 2017 and .NET Core, you don't need to install anything to work with dotnet in your powershell.
For this to work, you need to have putty installed from here, because this approach depends on some features from putty.
The steps in the article are executed in powershell on your own computer as follows:
dotnet new -i RaspberryPi.Template::* to install the templates for dotnet
cd path/to/a/directory to navigate to a folder where you want to create a new project
dotnet new coreiot -n HelloRaspbian to create a new project called 'HelloRaspbian'
cd HelloRaspbian to navigate into the project that just got created
Invoke-WebRequest http://cakebuild.net/download/bootstrapper/windows -OutFile build.ps1 to download the build&deploy script into your project.
- Open build.cake and edit the lines under ARGUMENTS (WITH DEFAULT PARAMETERS FOR LINUX (Ubuntu 16.04, Raspbian Jessie, etc) so that they refer to your raspberry.
- write your program in your newly created project using visual studio. If you want to use an existing project, you can copy all files and folders over to the new project. Don't forget to install the Discord.Net package in your new project using nuGet in visual studio.
.\build.ps1 to build your project and to send it to the raspberry. I noticed that non-code files don't get copied over, so I copied those over manually.
Your program should now be on your raspberry and you can start it like usual.
I hope this helps!