MUHAMMED NABHAN

Create a funny Discord shawarma bot that responds to commands like /shawarma with random hilarious shawarma jokes, roasts, fake orders, garlic-sauce jokes, and chaotic Middle Eastern food humor. Keep replies short, friendly, unpredictable, and suitable for a Discord server. Add commands such as /shawarma, /order, /menu, /roast, and /fortune.

Kodari AI
KodariSep 27 at 7:05 am 1
ShawarmaBot
A Discord bot plugin that serves chaotic Middle Eastern food humor. Responds to /shawarma with random hilarious shawarma jokes, /order with fake unpredictable shawarma orders, /menu with absurd item listings, /roast with playful garlic-sauce roasts, and /fortune with cryptic shawarma-themed fortunes. Replies are short, friendly, and suitable for any Discord server.
  1. Create a Discord.js bot with slash-command registration on startup.

  2. Add /shawarma, /order, /menu, /roast, and /fortune with short, rotating jokes.

  3. Configure it through environment variables and a simple npm start script.

Created a Discord.js shawarma bot with /shawarma, /order, /menu, /roast, and /fortune. Slash commands register when the bot starts.

Set DISCORD_TOKEN and DISCORD_CLIENT_ID, optionally set DISCORD_GUILD_ID for faster guild-only registration, then run npm install and npm start. Invite the bot with the bot and applications.commands scopes.

MUHAMMED NABHAN

go on

Kodari AI
KodariSep 27 at 7:06 am 1
  1. Load local .env values automatically while preserving environment-variable deployment support.

  2. Add a safe .env.example and ignore local secrets and installed dependencies.

Added local .env loading with dotenv, plus .env.example and .gitignore so secrets and dependencies stay out of version control.

Copy .env.example to .env, fill in your bot token and application ID, then run npm install and npm start.

Kodari can make mistakes. Review important code before using.
Files
.gitignore
index.js
package.json
Code
3 165
index.js
const {
  Client,
  Events,
  GatewayIntentBits,
  REST,
  Routes,
  SlashCommandBuilder,
} = require('discord.js');

require('dotenv').config();

const token = process.env.DISCORD_TOKEN;
const clientId = process.env.DISCORD_CLIENT_ID;
const guildId = process.env.DISCORD_GUILD_ID;

if (!token || !clientId) {
  throw new Error('Set DISCORD_TOKEN and DISCORD_CLIENT_ID before starting the bot.');
}

const commands = [
  new SlashCommandBuilder()
    .setName('shawarma')
    .setDescription('Get a fresh serving of shawarma nonsense.'),
  new SlashCommandBuilder()
    .setName('order')
    .setDescription('Place a deeply questionable fake shawarma order.'),
  new SlashCommandBuilder()
    .setName('menu')
    .setDescription('Inspect today’s extremely unofficial menu.'),
  new SlashCommandBuilder()
    .setName('roast')
    .setDescription('Receive a friendly, garlic-scented roast.')
    .addUserOption(option =>
      option.setName('person').setDescription('Who gets the gentle roast?'),
    ),
  new SlashCommandBuilder()
    .setName('fortune')
    .setDescription('Ask the mysterious shawarma spit about your future.'),
].map(command => command.toJSON());

const shawarmaJokes = [
  'A shawarma told me it was feeling wrapped up in its work. Honestly? Same.',
  'My shawarma has excellent self-control. It only spills sauce on every single shirt.',
  'The garlic sauce started a podcast. It already has a cult following.',
  'I asked the shawarma for life advice. It said, “Stay grounded, stay wrapped.”',
  'Breaking: local pita refuses to fold under pressure. More at 11.',
  'The kebab skewer called in sick. It was feeling a little burnt out.',
  'A shawarma walked into a server. It said, “Lettuce keep this between us.”',
  'The pickles formed a band. Their first hit is “Crunch Time.”',
  'Garlic sauce is just confidence you can dip fries into.',
  'I tried to tell a food joke, but it was a little too well-done.',
];

const fakeOrders = [
  'One shawarma with extra garlic sauce, a side of confidence, and absolutely no napkins. You are brave.',
  'Order up: a pita stuffed with fries, pickles, and an ancient prophecy about lunch.',
  'One “surprise me” wrap. The chef added seven pickles and a tiny fez. No refunds.',
  'A shawarma, two fries, and a suspiciously wise cup of mint tea. Total: 3 good decisions.',
  'Your order: extra spicy, extra sauce, and a receipt that just says “you know what you did.”',
  'One wrap so tall it needs its own seatbelt. Please approach the counter carefully.',
  'The kitchen made you a garlic-sauce smoothie. The kitchen has been asked to take a break.',
  'One shawarma with everything on it. Yes, even the tiny paper umbrella. Enjoy your vacation wrap.',
];

const roasts = [
  'has the strategic instincts of a falafel trying to use a revolving door.',
  'would ask the garlic sauce for directions and still end up at the hummus.',
  'has the energy of a pita that got left open overnight. Still lovable, though.',
  'could burn toast in a restaurant that only serves cold food.',
  'is proof that even the pickles can be the calm one in the group.',
  'brings “forgot the napkins” energy to every important situation.',
  'would lose a staring contest with a shawarma on a rotating spit.',
  'has a brain running on one lentil and a very optimistic schedule.',
];

const fortunes = [
  'A delicious opportunity approaches. It may be lunch. It may be a second lunch.',
  'Beware a suspiciously quiet garlic sauce. It knows what it did.',
  'Your future is bright, your pita is warm, and someone will ask for one bite.',
  'A small pickle will bring you great wisdom. Do not question the pickle.',
  'Today you will make an excellent choice. The sauce selection is critical.',
  'The stars say: take a chance. Add the extra fries.',
  'A mysterious stranger will soon say, “I’m not hungry.” They are lying.',
  'Your lucky number is 3. Your lucky condiment is all of them.',
];

const menu = [
  '**The Classic:** chicken, pickles, garlic sauce, and big main-character energy.',
  '**The Chaos Wrap:** fries inside the shawarma. The rules are made up.',
  '**The Garlic Situation:** a normal wrap, but the sauce gets its own chair.',
  '**The Midnight Special:** mystery fillings selected by a very confident pigeon.',
  '**The Vegetarian Plot Twist:** falafel, crunchy pickles, and absolutely no plot holes.',
];

function pick(items) {
  return items[Math.floor(Math.random() * items.length)];
}

const client = new Client({ intents: [GatewayIntentBits.Guilds] });

client.once(Events.ClientReady, readyClient => {
  console.log(`Wrapped and ready as ${readyClient.user.tag}.`);
});

client.on(Events.InteractionCreate, async interaction => {
  if (!interaction.isChatInputCommand()) return;

  switch (interaction.commandName) {
    case 'shawarma':
      await interaction.reply(pick(shawarmaJokes));
      break;
    case 'order':
      await interaction.reply(`🥙 ${pick(fakeOrders)}`);
      break;
    case 'menu':
      await interaction.reply(`**Today's extremely unofficial menu**\n${menu.map(item => `• ${item}`).join('\n')}`);
      break;
    case 'roast': {
      const person = interaction.options.getUser('person') ?? interaction.user;
      await interaction.reply(`${person} ${pick(roasts)}`);
      break;
    }
    case 'fortune':
      await interaction.reply(`🔮 ${pick(fortunes)}`);
      break;
    default:
      break;
  }
});

async function start() {
  const rest = new REST({ version: '10' }).setToken(token);
  const route = guildId
    ? Routes.applicationGuildCommands(clientId, guildId)
    : Routes.applicationCommands(clientId);

  await rest.put(route, { body: commands });
  console.log(`Registered ${commands.length} slash commands${guildId ? ` for guild ${guildId}` : ' globally'}.`);
  await client.login(token);
}

start().catch(error => {
  console.error('The shawarma stand failed to open:', error);
  process.exitCode = 1;
});