Bots/Giveaway Bot

Giveaway Bot

by btlfrt12 · 0 clones · 53 views

Invite to Discord

Free Discord Giveaway Bot — Open-Source Alternative to GiveawayBot

A fully-featured giveaway system for your Discord server with button-based entries, timed draws, multiple winners, and customizable embeds. Same commands as GiveawayBot.party — zero learning curve.

Commands

  • /gstart <time> <winners> <prize> — Start a timed giveaway (supports seconds, minutes, hours, days)
  • /gcreate — Interactive giveaway setup with guided prompts
  • /gend <id> — End a giveaway early and pick winners immediately
  • /greroll <id> — Reroll a new winner from an ended giveaway
  • /gdelete <id> — Delete a giveaway without picking winners
  • /glist — List all active giveaways on your server
  • /gsettings set color <hex> — Customize embed colors
  • /gsettings set emoji <emoji> — Customize the entry button emoji
  • /ghelp — View all available commands
  • /gabout — Bot info and stats
  • /ginvite — Get the bot invite link

Why Use This Over GiveawayBot?

  • Free forever — No premium tiers, no paywalls
  • Open source — Full source code included, MIT licensed
  • Customizable — Modify anything, add features with AI
  • Self-hosted — Your data stays on your server
  • No vendor lock-in — You own the bot and the code

Features

  • Button-based giveaway entries — no reactions needed
  • Flexible time formats — 30s, 5m, 2h, 1d
  • Multiple winners support
  • Reroll winners from ended giveaways
  • Customizable embed colors and entry emojis
  • Permission-based — only Giveaway Managers can create/manage
  • Active giveaway listing per server

View Source on GitHub

9

Commands

20

Files

0

Clones

53

Views

1

Servers

2

Members

Source Code

bot.config.json8 lines
1{
2 "botName": "My Bot",
3 "brandColor": "#5865F2",
4 "guildId": "",
5 "channels": {},
6 "roles": {},
7 "modules": {}
8}
data/bot.db1 lines
1SQLite format 3@ .�* 
data/bot.db-shm3 lines
1�-Hg zy[9[���k�0���RA@xw�-Hg zy[9[���k�0���RA@xw������������
2
3 
data/bot.db-wal25 lines
17�-����k�0�@�� ������k�0��g�Hy!UFSQLite format 3@ .�* �����c))�tableguild_settingsguild_settingsCREATE TABLE guild_settings (
2 guild_id TEXT PRIMARY KEY,
3 embed_color TEXT DEFAULT '#FF6B6B',
4 entry_emoji TEXT DEFAULT '🎉',
5 created_at INTEGER DEFAULT (strftime('%s', 'now'))
6);O)indexsqlite_autoindex_guild_settings_1guild_settings���k�0�`�y��h� ���k�0����7K��
7���k�0�e��[�y[SQLite format 3@ .�* � �� R P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)��OtablegiveawaysgiveawaysCREATE TABLE giveaways (
8 id INTEGER PRIMARY KEY AUTOINCREMENT,
... 17 more lines
package-lock.json657 lines
1{
2 "name": "my-discord-bot",
3 "version": "1.0.0",
4 "lockfileVersion": 3,
5 "requires": true,
6 "packages": {
7 "": {
8 "name": "my-discord-bot",
... 649 more lines
package.json10 lines
1{
2 "name": "my-discord-bot",
3 "version": "1.0.0",
4 "type": "module",
5 "dependencies": {
6 "discord.js": "^14.16.0",
7 "better-sqlite3": "^11.0.0",
8 "dotenv": "^16.4.0"
... 2 more lines
src/bot.config.json8 lines
1{
2 "botName": "My Bot",
3 "brandColor": "#5865F2",
4 "guildId": "",
5 "channels": {},
6 "roles": {},
7 "modules": {}
8}
src/commands/gabout.js23 lines
1import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
2
3export const data = new SlashCommandBuilder()
4 .setName('gabout')
5 .setDescription('Shows information about the giveaway bot');
6
7export async function execute(interaction) {
8 const embed = new EmbedBuilder()
... 15 more lines
src/commands/gdelete.js41 lines
1import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
2import { get, run } from '../db.js';
3
4export const data = new SlashCommandBuilder()
5 .setName('gdelete')
6 .setDescription('Delete a giveaway without picking winners')
7 .addIntegerOption(option =>
8 option.setName('giveaway_id')
... 33 more lines
src/commands/gend.js73 lines
1import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
2import { get, run } from '../db.js';
3
4export const data = new SlashCommandBuilder()
5 .setName('gend')
6 .setDescription('End a running giveaway and pick winners')
7 .addIntegerOption(option =>
8 option.setName('giveaway_id')
... 65 more lines
src/commands/ghelp.js27 lines
1import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
2
3export const data = new SlashCommandBuilder()
4 .setName('ghelp')
5 .setDescription('Shows available giveaway commands');
6
7export async function execute(interaction) {
8 const embed = new EmbedBuilder()
... 19 more lines
src/commands/ginvite.js23 lines
1import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
2
3export const data = new SlashCommandBuilder()
4 .setName('ginvite')
5 .setDescription('Get the bot invite link to add to other servers');
6
7export async function execute(interaction) {
8 const clientId = interaction.client.user.id;
... 15 more lines
src/commands/glist.js39 lines
1import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
2import { all } from '../db.js';
3
4export const data = new SlashCommandBuilder()
5 .setName('glist')
6 .setDescription('List all running giveaways in this server');
7
8export async function execute(interaction) {
... 31 more lines
src/commands/greroll.js61 lines
1import { SlashCommandBuilder, EmbedBuilder } from 'discord.js';
2import { get, run } from '../db.js';
3
4export const data = new SlashCommandBuilder()
5 .setName('greroll')
6 .setDescription('Reroll winners for an ended giveaway')
7 .addIntegerOption(option =>
8 option.setName('giveaway_id')
... 53 more lines
src/commands/gsettings.js80 lines
1import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
2import { get, run } from '../db.js';
3
4// Create settings table
5run(`CREATE TABLE IF NOT EXISTS guild_settings (
6 guild_id TEXT PRIMARY KEY,
7 embed_color TEXT DEFAULT '#FF6B6B',
8 entry_emoji TEXT DEFAULT '🎉',
... 72 more lines
src/commands/gstart.js135 lines
1import { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
2import { run, get } from '../db.js';
3
4// Create giveaways table
5run(`CREATE TABLE IF NOT EXISTS giveaways (
6 id INTEGER PRIMARY KEY AUTOINCREMENT,
7 guild_id TEXT NOT NULL,
8 channel_id TEXT NOT NULL,
... 127 more lines
src/db.js38 lines
1import Database from 'better-sqlite3';
2import path from 'path';
3import { fileURLToPath } from 'url';
4
5const __dirname = path.dirname(fileURLToPath(import.meta.url));
6const dbPath = path.join(__dirname, '..', 'data', 'bot.db');
7
8// Ensure data directory exists
... 30 more lines
src/events/interactionCreate.js58 lines
1import { get, run } from '../db.js';
2
3export const name = 'interactionCreate';
4export const once = false;
5
6export async function execute(interaction) {
7 // Handle slash commands
8 if (interaction.isChatInputCommand()) {
... 50 more lines
src/index.js91 lines
1import 'dotenv/config';
2import { Client, GatewayIntentBits, Collection, REST, Routes } from 'discord.js';
3import fs from 'fs';
4import path from 'path';
5import { fileURLToPath } from 'url';
6
7const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
... 83 more lines
src/utils/format.js18 lines
1export function abbreviateNumber(num) {
2 if (num >= 1_000_000_000) return (num / 1_000_000_000).toFixed(1) + 'B';
3 if (num >= 1_000_000) return (num / 1_000_000).toFixed(1) + 'M';
4 if (num >= 1_000) return (num / 1_000).toFixed(1) + 'K';
5 return num.toString();
6}
7
8export function demandLabel(demand) {
... 10 more lines

Use this bot

Add it to your Discord server, or clone the source code and customize it.

Invite to Discord