Lethal Company
This package has been deprecated and may no longer be maintained. We recommend looking for an alternative.
Install with App

Details

Latest version
1.0.0
Last Updated
First Uploaded
Downloads
61
Likes
0
Size
211KB
Dependants

Categories

Tags

Deprecated

Uhhm, stuff so I guess you want to know how to do this so basically...

This is used with a discord bot11!1!! Yeah you're friends watch your stream or something and then when they feel like it they spawn a bracken omgggomgg!!1!

Make a discord bot I won't be going through that serach up a yutub tutorial and yeah and for the python script for the thing should be like idk like


import discord from discord.ext import commands from flask import Flask, request, jsonify

app = Flask(name)

Define valid enemy names and items

valid_enemy_names = [ "baboon hawk", "bracken", "bunker spider", "butler", "coilhead", "earth leviathan", "eyeless dog", "forest keeper", "ghost girl", "hoarding bug", "hydrogere", "jester", "masked", "mask hornets", "nutcracker", "old bird", "snare flea", "spore lizard", "thumper", "tulip snakes" ]

valid_items = [ "radio", "flashlight", "shovel", "lockpicker", "pro", "stun", "grenade", "boombox", "drugs", "zap", "jetpack", "ladder", "radar", "spray", "paint" ]

Initialize bot with command prefix and intents

intents = discord.Intents.default() intents.message_content = True bot = commands.Bot(command_prefix='?', intents=intents)

Discord channel ID where you want to send messages

target_channel_id = CHANNEL ID # Replace with the actual channel ID

@app.route('/discord-bot-command', methods=['POST']) def discord_bot_command(): data = request.json command = data.get('command') if command: bot.loop.create_task(handle_command(command)) return jsonify({'status': 'success'}), 200 return jsonify({'status': 'error', 'message': 'Invalid command'}), 400

async def handle_command(command): channel = bot.get_channel(target_channel_id) if command.startswith('spawn '): enemy_name = command.split('spawn ')[1] if enemy_name in valid_enemy_names: await channel.send(f'Spawned {enemy_name}!') else: await channel.send("This enemy is either disabled or you spelt it wrong (remember it's case sensitive (all lower-caps))") elif command.startswith('give '): item_name = command.split('give ')[1] if item_name in valid_items: await channel.send(f'Gave {item_name}!') else: await channel.send("This isn't an item (remember it's case sensitive (all lower-caps))")

@bot.event async def on_ready(): print(f'Logged in as {bot.user}')

@bot.command(name='spawn') async def spawn(ctx, *, enemy_name: str): if enemy_name.lower() in valid_enemy_names: await ctx.send(f'{ctx.author.name} spawned {enemy_name}!') target_channel = bot.get_channel(target_channel_id) if target_channel: await target_channel.send(f'{ctx.author.name} spawned {enemy_name}!') else: await ctx.send("This enemy is either disabled or you spelt it wrong (remember it's case sensitive (all lower-caps))")

@bot.command(name='give') async def give(ctx, *, item_name: str): if item_name.lower() in valid_items: await ctx.send(f'{ctx.author.name} gave {item_name}!') target_channel = bot.get_channel(target_channel_id) if target_channel: await target_channel.send(f'{ctx.author.name} gave {item_name}!') else: await ctx.send("This isn't an item (remember it's case sensitive (all lower-caps))")

@bot.command(name='enemy') async def list_enemies(ctx): valid_enemies = ', '.join(valid_enemy_names) await ctx.send(f"Here are all the valid enemies: {valid_enemies}")

@bot.command(name='item') async def list_items(ctx): valid_items_list = ', '.join(valid_items) await ctx.send(f"Here are all the valid items: {valid_items_list}")

@bot.event async def on_command_error(ctx, error): if isinstance(error, commands.CommandNotFound): await ctx.send("That command doesn't exist.") elif isinstance(error, commands.MissingRole): await ctx.send("You don't have the required role to use this command.") else: await ctx.send("An error occurred while processing your command.") print(error)

Run the bot with the token

if name == "main": import threading threading.Thread(target=lambda: app.run(port=8080)).start() bot.run('YOUR BOT TOKEN')


and all you need to know is that the bot.run('YOUR BOT TOKEN') you should change YOUR BOT TOKEN with your actual bot token and somewhere in the middle of the code there is a CHANNEL ID which you change to the channel id you're friends will be messaging the ?spawn bracken messagages stuff in the channel yeah

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.