KreekCraft :D il KreekCraft

Can you make me a good discord bot for my staff can you make Make me a complete CHILL PvP DAYZ bot with /rules, /ticket, /verify, /staff, /boost, welcome messages, and a cool custom status and for staff like staff-blacklist and warnings and enforcement

Kodari AI
KodariSep 16 at 9:46 am 1
ChillPvPStaffBot
A complete Discord staff management bot for Chill PvP DAYZ servers. Features slash commands including /rules, /ticket, /verify, /staff, and /boost. Sends automated welcome messages for new members and displays a custom rotating status. Provides staff-only moderation tools such as /staff-blacklist to ban problematic users and a /warnings system to track and enforce infractions. Includes ticket creation and verification workflows to streamline community support and member authentication.
  1. Create the Discord.js bot foundation, environment configuration, persistent JSON storage, and command deployment script.

  2. Implement public commands, ticket/verification buttons, welcome and boost events, rotating custom status, and staff moderation tools.

  3. Add setup documentation and safe defaults for running the bot.

Built the complete Chill PvP DayZ Discord bot with:

  • /rules

  • /ticket

  • /verify

  • /boost

  • /staff moderation tools:

    • blacklist add/remove/list

    • warnings, unwarn, clear warnings

    • kick, timeout, ban, unban

  • Private ticket channels with close buttons

  • Verification role assignment

  • Welcome messages

  • Automatic boost announcements and booster role assignment

  • Rotating custom status

  • Staff and ticket logging

  • Persistent JSON storage

  • Environment-based configuration

  • Setup documentation

Run it with:

Shell
npm install
cp .env.example .env
npm run deploy
npm start

Configure the role and channel IDs in .env before starting.

KreekCraft :D il KreekCraft

Can you show me what it can do

Kodari AI
KodariSep 16 at 9:54 am 1

Here’s what the Chill PvP DayZ Discord bot can do.

Public commands

/rules

Displays a polished rules embed for your server, such as:

  • No cheating or exploiting

  • No harassment

  • No advertising

  • Respect staff

  • Follow DayZ server rules

  • Punishments may be issued at staff discretion

/ticket reason:<text>

Creates a private support ticket channel.

Example:

Plain Text
/ticket reason: I need help reporting a player

The ticket is visible to the ticket creator and staff. Staff can close it using the ticket close button. Ticket actions can also be sent to your configured log channel.

/verify

Posts a verification panel with a button. When a member clicks it, the bot assigns your configured verification role.

/boost

Shows server booster information and explains the benefits of boosting. When somebody boosts the server, the bot can:

  • Announce the boost

  • Assign the configured booster role

  • Thank the booster publicly

Automatic features

Welcome messages

When a new member joins, the bot can send a welcome message containing:

  • Their username

  • The server name

  • Instructions to verify

  • A friendly Chill PvP DayZ greeting

Booster announcements

The bot automatically detects new server boosts and announces them in the configured welcome or log channel.

Custom status

The bot rotates through custom watching statuses, such as:

Plain Text
Watching Chill PvP DayZ
Watching over the community
Protecting the server
Helping staff

Staff commands

All staff commands are grouped under /staff.

Blacklist management

Plain Text
/staff blacklist-add user:<member> reason:<reason>

Adds a player to the staff blacklist.

Plain Text
/staff blacklist-remove user:<member>

Removes a player from the blacklist.

Plain Text
/staff blacklist-list

Displays the current staff blacklist.

Warning system

Plain Text
/staff warn user:<member> reason:<reason>

Issues a formal warning.

Plain Text
/staff warnings user:<member>

Displays a member’s warning history.

Plain Text
/staff unwarn user:<member>

Removes the latest warning.

You can also remove a specific warning:

Plain Text
/staff unwarn user:<member> warning_id:<id>
Plain Text
/staff clearwarnings user:<member>

Clears all warnings for a member.

Warnings and blacklist entries are stored persistently, so they remain after the bot restarts.

Enforcement tools

Plain Text
/staff kick user:<member> reason:<reason>

Kicks a member.

Plain Text
/staff timeout user:<member> minutes:<number> reason:<reason>

Times out a member for between 1 minute and 28 days.

Plain Text
/staff ban user:<member> reason:<reason>

Bans a member.

Plain Text
/staff unban user_id:<Discord ID> reason:<reason>

Unbans a user by their Discord ID.

Staff access

Staff tools are restricted to:

  • Administrators

  • Members with Manage Server

  • Members with the configured staff role

The bot still follows Discord’s role hierarchy, so its role must be above members it needs to timeout, kick, ban, verify, or assign roles to.

Example staff workflow

A typical report could work like this:

Plain Text
/ticket reason: Player is using suspicious hacks

A staff member investigates the report, then uses:

Plain Text
/staff warn user:@Player reason: Confirmed rule violation

For repeated offenses:

Plain Text
/staff timeout user:@Player minutes:1440 reason: Repeated violations

For serious or repeated abuse:

Plain Text
/staff ban user:@Player reason: Severe rule violations

Every warning, blacklist action, and enforcement action can be recorded in the configured moderation log channel.

KreekCraft :D il KreekCraft

How do i get it up in my Discord

Kodari AI
KodariSep 16 at 10:47 am 1

1. Create the Discord application

  1. Click New Application.

  2. Name it something like Chill PvP DayZ.

  3. Open the Bot tab and click Add Bot.

  4. Click Reset Token, copy the new token, and keep it private.

Important: The current .env.example appears to contain a token-like value. If it is a real token, reset it immediately. Never share your bot token publicly.

2. Enable intents

In the bot’s Privileged Gateway Intents section, enable:

  • Server Members Intent

  • Message Content Intent

Click Save Changes.

3. Invite the bot

Go to OAuth2 → URL Generator and select:

Scopes

  • bot

  • applications.commands

Bot permissions

Select at least:

  • View Channels

  • Send Messages

  • Embed Links

  • Read Message History

  • Manage Channels

  • Manage Roles

  • Moderate Members

  • Kick Members

  • Ban Members

Open the generated URL, select your Discord server, and authorize the bot.

4. Prepare the configuration

In the bot folder, copy the example configuration:

Windows PowerShell

Powershell
Copy-Item .env.example .env

Linux/macOS

Shell
cp .env.example .env

Open .env and fill it in:

Env
DISCORD_TOKEN=your_new_bot_token
CLIENT_ID=your_application_id
GUILD_ID=your_server_id

STAFF_ROLE_ID=your_staff_role_id
VERIFY_ROLE_ID=your_verified_role_id
BOOST_ROLE_ID=your_booster_role_id
WELCOME_CHANNEL_ID=your_welcome_channel_id
LOG_CHANNEL_ID=your_log_channel_id
TICKET_CATEGORY_ID=your_ticket_category_id

Use raw Discord IDs only, not channel URLs.

To copy IDs:

  1. Open Discord settings.

  2. Go to Advanced.

  3. Enable Developer Mode.

  4. Right-click your server, role, channel, or category.

  5. Click Copy ID.

You can also customize:

Env
SERVER_NAME=Chill PvP DayZ
SERVER_INVITE=https://discord.gg/your-invite
SERVER_IP=your.server.ip
SERVER_VERSION=1.21+
SUPPORT_MESSAGE=Open a ticket and staff will help you.

5. Deploy and start the bot

Open a terminal in the project folder and run:

Shell
npm install
npm run deploy
npm start

When it works, you should see the bot log in. The slash commands will appear in the server listed in GUILD_ID.

The bot will then provide:

Plain Text
/rules
/ticket
/verify
/boost
/staff

If you leave GUILD_ID blank, commands deploy globally, but Discord may take up to an hour to display them.

6. Fix role hierarchy

In your Discord server:

  1. Go to Server Settings → Roles.

  2. Move the bot’s role above:

    • The verification role

    • The booster role

    • Any members the bot needs to moderate

  3. Keep the bot below your owner and highest administrator roles.

Without this, verification, warnings, kick, timeout, and ban actions may fail.

Keeping it online

Running npm start keeps it online only while the terminal remains open. For a VPS, use PM2:

Shell
npm install
npm run deploy
npm install -g pm2
pm2 start src/index.js --name chillpvp-bot
pm2 save
pm2 startup

The bot will then restart automatically if it crashes or the server reboots.

KreekCraft :D il KreekCraft

Can we teat it

Kodari AI
KodariSep 16 at 10:49 am 1

Yes. Test it in a separate private Discord server first.

  1. Create a test server and invite the bot with the required permissions.

  2. Fill in .env with the test server’s IDs and bot token.

  3. Run:

Shell
npm install
npm run deploy
npm start
  1. In Discord, test:

Plain Text
/rules
/verify
/boost
/ticket reason: Testing the support system

Then test staff tools:

Plain Text
/staff warnings user:@TestUser
/staff warn user:@TestUser reason: Test warning
/staff warnings user:@TestUser
/staff unwarn user:@TestUser
/staff blacklist-add user:@TestUser reason: Test blacklist
/staff blacklist-list
/staff blacklist-remove user:@TestUser

Finally, test enforcement with a test account:

Plain Text
/staff timeout user:@TestUser minutes:1 reason: Test timeout
/staff kick user:@TestUser reason: Test kick

You can also test automatic features by:

  • Joining the test server with another account to trigger the welcome message.

  • Boosting the server to test the boost announcement.

  • Opening and closing a ticket.

  • Restarting the bot to confirm warnings and blacklist entries persist.

Do not share DISCORD_TOKEN or your .env file. If the bot does not respond, check the terminal output and send me the error message—without including the token.

Kodari can make mistakes. Review important code before using.
Files
src
.gitignore
deploy-commands.js
package.json
README.md
Code
8 587
src/index.js
const path = require('node:path');
const {
  Client,
  GatewayIntentBits,
  Partials,
  ActivityType,
  ChannelType,
  PermissionFlagsBits,
  EmbedBuilder,
  ActionRowBuilder,
  ButtonBuilder,
  ButtonStyle
} = require('discord.js');
const config = require('./config');
const Store = require('./store');

if (!config.token) throw new Error('DISCORD_TOKEN is missing. Add it to .env.');

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildModeration,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent
  ],
  partials: [Partials.GuildMember, Partials.User, Partials.Channel]
});
const store = new Store(path.join(__dirname, '..', 'data', 'server-data.json'));
const colors = { red: 0xE74C3C, orange: 0xF39C12, green: 0x2ECC71, blue: 0x3498DB, purple: 0x9B59B6, dark: 0x18212B };

function baseEmbed(color = colors.blue) {
  return new EmbedBuilder().setColor(color).setTimestamp().setFooter({ text: config.serverName });
}

function rulesEmbed() {
  return baseEmbed(colors.red)
    .setTitle(`${config.serverName} — Rules`)
    .setDescription([
      '**1. Respect everyone**\nNo harassment, hate speech, threats, or targeted abuse.',
      '**2. No cheating**\nDo not use cheats, exploits, dupes, combat logging, or unauthorized clients.',
      '**3. Keep it appropriate**\nNo spam, malicious links, advertising, or unsafe content.',
      '**4. Use the right channels**\nKeep support, reports, and general chat in their intended places.',
      '**5. Follow staff direction**\nDo not evade punishments or interfere with an active investigation.',
      '**6. Have fun**\nPvP is encouraged; ruining the community is not.'
    ].join('\n\n'))
    .addFields({ name: 'Enforcement', value: 'Punishments can include warnings, timeouts, kicks, bans, and blacklist actions depending on severity.' });
}

function isStaff(interaction) {
  return interaction.memberPermissions?.has(PermissionFlagsBits.Administrator) ||
    interaction.memberPermissions?.has(PermissionFlagsBits.ManageGuild) ||
    Boolean(config.staffRoleId && interaction.member?.roles?.cache?.has(config.staffRoleId));
}

function hasHigherOrEqualRole(interaction, target) {
  if (!interaction.member?.roles?.highest || !target.roles?.highest) return true;
  return interaction.member.roles.highest.comparePositionTo(target.roles.highest) > 0;
}

function getMember(interaction, userId) {
  return interaction.guild.members.cache.get(userId) || null;
}

async function sendLog(guild, title, description, color = colors.dark) {
  if (!config.logChannelId) return;
  const channel = await guild.channels.fetch(config.logChannelId).catch(() => null);
  if (channel?.isTextBased()) await channel.send({ embeds: [baseEmbed(color).setTitle(title).setDescription(description)] }).catch(() => null);
}

async function replyEphemeral(interaction, content) {
  if (interaction.replied || interaction.deferred) return interaction.followUp({ content, ephemeral: true });
  return interaction.reply({ content, ephemeral: true });
}

async function handleRules(interaction) {
  await interaction.reply({ embeds: [rulesEmbed()] });
}

async function handleVerifyPanel(interaction) {
  const row = new ActionRowBuilder().addComponents(
    new ButtonBuilder().setCustomId('verify-member').setLabel('Verify me').setEmoji('✅').setStyle(ButtonStyle.Success)
  );
  const embed = baseEmbed(colors.green)
    .setTitle('Member verification')
    .setDescription('Click **Verify me** to receive access to the community. If the button does not work, open a ticket.');
  await interaction.reply({ embeds: [embed], components: [row] });
}

async function handleBoost(interaction) {
  const boostRole = config.boostRoleId ? `<@&${config.boostRoleId}>` : 'the Booster role';
  const embed = baseEmbed(colors.purple)
    .setTitle('Support the server with a boost')
    .setDescription(`Boosting helps keep ${config.serverName} online and growing.\n\nBoosters receive ${boostRole} and our appreciation. Thanks for supporting the wasteland!`)
    .addFields({ name: 'Server address', value: `\`${config.serverIp}\``, inline: true }, { name: 'Version', value: config.serverVersion, inline: true });
  await interaction.reply({ embeds: [embed] });
}

async function handleTicket(interaction) {
  const existing = Object.values(store.guild(interaction.guildId).tickets).find((ticket) => ticket.userId === interaction.user.id);
  if (existing) {
    const channel = interaction.guild.channels.cache.get(existing.channelId);
    if (channel) return replyEphemeral(interaction, `You already have an open ticket: ${channel}`);
    store.deleteTicket(interaction.guildId, existing.channelId);
  }

  const safeName = interaction.user.username.toLowerCase().replace(/[^a-z0-9]/g, '').slice(0, 16) || 'user';
  const permissionOverwrites = [
    { id: interaction.guild.id, deny: [PermissionFlagsBits.ViewChannel] },
    { id: interaction.user.id, allow: [PermissionFlagsBits.ViewChannel, PermissionFlagsBits.SendMessages, PermissionFlagsBits.ReadMessageHistory] }
  ];
  if (config.staffRoleId) {
    permissionOverwrites.push({ id: config.staffRoleId, allow: [PermissionFlagsBits.ViewChannel, PermissionFlagsBits.SendMessages, PermissionFlagsBits.ReadMessageHistory] });
  }

  const channel = await interaction.guild.channels.create({
    name: `ticket-${safeName}`,
    type: ChannelType.GuildText,
    parent: config.ticketCategoryId || undefined,
    topic: `Support ticket opened by ${interaction.user.tag}`,
    permissionOverwrites
  });
  store.setTicket(interaction.guildId, channel.id, { userId: interaction.user.id, username: interaction.user.tag, reason: interaction.options.getString('reason'), createdAt: new Date().toISOString(), channelId: channel.id });

  const closeRow = new ActionRowBuilder().addComponents(
    new ButtonBuilder().setCustomId('close-ticket').setLabel('Close ticket').setEmoji('🔒').setStyle(ButtonStyle.Danger)
  );
  const embed = baseEmbed(colors.orange)
    .setTitle(`Support ticket — ${interaction.user.username}`)
    .setDescription(`${config.supportMessage}\n\n**Reason:** ${interaction.options.getString('reason')}`)
    .addFields({ name: 'Opened by', value: `${interaction.user}`, inline: true }, { name: 'Staff', value: config.staffRoleId ? `<@&${config.staffRoleId}>` : 'Staff team', inline: true });
  await channel.send({ content: `${interaction.user} ${config.staffRoleId ? `<@&${config.staffRoleId}>` : ''}`, embeds: [embed], components: [closeRow] });
  await interaction.reply({ content: `Your ticket has been created: ${channel}`, ephemeral: true });
  await sendLog(interaction.guild, 'Ticket opened', `${interaction.user} opened ${channel} for: ${interaction.options.getString('reason')}`, colors.orange);
}

async function handleStaff(interaction) {
  if (!isStaff(interaction)) return replyEphemeral(interaction, 'You do not have permission to use staff tools.');
  const action = interaction.options.getSubcommand();
  const guild = interaction.guild;
  const user = interaction.options.getUser('user');
  const member = user ? getMember(interaction, user.id) : null;
  const reason = interaction.options.getString('reason') || 'No reason provided';

  if (['kick', 'timeout', 'ban'].includes(action) && (!member || !hasHigherOrEqualRole(interaction, member))) {
    return replyEphemeral(interaction, 'That member is not available or has an equal/higher role than you.');
  }

  if (action === 'blacklist-add') {
    const entry = store.addBlacklist(guild.id, user.id, user.tag, reason, interaction.user.id);
    await interaction.reply({ content: `Added **${user.tag}** to the staff blacklist. Entry ID: \\`${entry.createdAt}\\``, ephemeral: true });
    return sendLog(guild, 'Blacklist entry added', `${user} was blacklisted by ${interaction.user}.\n**Reason:** ${reason}`, colors.red);
  }
  if (action === 'blacklist-remove') {
    const removed = store.removeBlacklist(guild.id, user.id);
    await interaction.reply({ content: removed ? `Removed **${user.tag}** from the staff blacklist.` : `${user.tag} was not on the staff blacklist.`, ephemeral: true });
    return sendLog(guild, 'Blacklist entry removed', `${user} was removed from the blacklist by ${interaction.user}.`, colors.green);
  }
  if (action === 'blacklist-list') {
    const entries = store.getBlacklist(guild.id);
    const description = entries.length ? entries.map((entry) => `• **${entry.username}** (<@${entry.userId}>) — ${entry.reason}`).join('\n') : 'The staff blacklist is empty.';
    return interaction.reply({ embeds: [baseEmbed(colors.red).setTitle('Staff blacklist').setDescription(description).setFooter({ text: `${entries.length} entr${entries.length === 1 ? 'y' : 'ies'}` })], ephemeral: true });
  }
  if (action === 'warn') {
    const warning = store.addWarning(guild.id, user.id, user.tag, reason, interaction.user.id);
    await interaction.reply({ content: `Warned **${user.tag}**. Warning ID: \\`${warning.id}\\``, ephemeral: true });
    await user.send(`You received a warning in **${guild.name}**.\nReason: ${reason}`).catch(() => null);
    return sendLog(guild, 'Member warned', `${user} was warned by ${interaction.user}.\n**Reason:** ${reason}\n**ID:** ${warning.id}`, colors.orange);
  }
  if (action === 'warnings') {
    const warnings = store.getWarnings(guild.id, user.id);
    const description = warnings.length ? warnings.map((warning, index) => `**${index + 1}. ${warning.id}** — ${warning.reason}\nIssued <t:${Math.floor(new Date(warning.createdAt).getTime() / 1000)}:R> by <@${warning.moderatorId}>`).join('\n\n') : 'This player has no warnings.';
    return interaction.reply({ embeds: [baseEmbed(colors.orange).setTitle(`Warnings — ${user.tag}`).setDescription(description)], ephemeral: true });
  }
  if (action === 'unwarn') {
    const warning = store.removeWarning(guild.id, user.id, interaction.options.getString('warning_id'));
    await interaction.reply({ content: warning ? `Removed warning **${warning.id}** from ${user.tag}.` : 'No matching warning was found.', ephemeral: true });
    if (warning) return sendLog(guild, 'Warning removed', `Warning ${warning.id} for ${user} was removed by ${interaction.user}.`, colors.green);
    return undefined;
  }
  if (action === 'clearwarnings') {
    const count = store.clearWarnings(guild.id, user.id);
    await interaction.reply({ content: `Cleared ${count} warning${count === 1 ? '' : 's'} for ${user.tag}.`, ephemeral: true });
    return sendLog(guild, 'Warnings cleared', `${interaction.user} cleared warnings for ${user}.`, colors.green);
  }
  if (action === 'kick') {
    await member.kick(reason);
    await interaction.reply({ content: `Kicked **${user.tag}**.`, ephemeral: true });
    return sendLog(guild, 'Member kicked', `${user} was kicked by ${interaction.user}.\n**Reason:** ${reason}`, colors.red);
  }
  if (action === 'timeout') {
    const minutes = interaction.options.getInteger('minutes');
    await member.timeout(minutes * 60 * 1000, reason);
    await interaction.reply({ content: `Timed out **${user.tag}** for ${minutes} minute${minutes === 1 ? '' : 's'}.`, ephemeral: true });
    return sendLog(guild, 'Member timed out', `${user} was timed out by ${interaction.user} for ${minutes} minutes.\n**Reason:** ${reason}`, colors.orange);
  }
  if (action === 'ban') {
    await member.ban({ reason });
    await interaction.reply({ content: `Banned **${user.tag}**.`, ephemeral: true });
    return sendLog(guild, 'Member banned', `${user} was banned by ${interaction.user}.\n**Reason:** ${reason}`, colors.red);