Git Product home page Git Product logo

dnetbottemplate's Introduction

DNetBot - A Discord Bot built using Dot Net Core

A Simple Discord Bot using the Discord .NET Bot library and Dot Net Core. This bot is built with a microservices architecture using a range of Azure Services such as Functions and Event Grid. I'm trying to build this bot in a modular fashion with the basic functionality provide and documented in such a way as to be expandable by others.

Quick Start

This bot now uses GitHub actions to build and deploy the infrastructure and code to Microsoft Azure. To get the bot up and running for you as quickly as possible you will need to:

  1. Ensure you have an Azure Tenancy with a Resource Group setup and ready to go, as well as Discord Developer Account with an application and bot token.
  2. Create a Service Principle with access to this Resource Group and save the corresponding JSON output. You do this with the Azure Command Line or the Cloud Shell with the following command line:
    • az ad sp create-for-rbac --name "github-deployer" --sdk-auth --role contributor --scopes /subscriptions/<YOUR_SUBSCRIPTION_ID>/resourcegroups/<YOUR_RESOURCE_GROUP>
  3. Fork the main branch or releases of this repository into your GitHub own account
  4. Add the following secrets to your repository:
    • AZURE_CREDENTIALS with the JSON from step 1
    • SUBSCRIPTION_ID with your Azure Subscription ID
    • DISCORD_BOT_TOKEN with your Bot token from the Discord Developer Portal
    • WEBHOOK_TOKEN with a generated secret of your choice to protect your webhooks
  5. Modify the environment variables at the top of the deployment.yml file to suit your needs / customize the naming of resources:
env:
    DNETBOT_NAME: 'discordnetbot'   # DNet Bot Naming Prefix for Resources (Lowercase, No Spaces or Special Characters)
    DOTNET_VERSION: '3.1.403'       # SDK Version to use
    AZURE_LOCATION: 'eastus'        # Resource Location
    AZURE_RG: 'RG-DNet-Bot'         # Resource Group Name to use
    AZURE_WEB_SKU: 'B1'             # Size of the WebApp to deploy
  1. Create a new release or manually trigger the workflow to deploy the bot to your Azure instance.
  2. Currently the application will only respond to the !ping command with "pong!".

To extend this bot and add your own event handlers there is documentation in the wiki.

Project Documentation

  • The wiki contains all the relevant documentation about using and expanding upon the Discord Bot to implement your own functionality.
  • The change log has both the history of changes and current changes in development
  • My website has a number of posts about the development and background of this bot template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.