Skip to content

Destarianon/FawxBazaarBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FAWX Bazaar Bot

This discord bot provides a basic interface for making sell/trade listings for your private discord server. I wrote this due to forum channels being unavailable to private discord servers. This is a clunky, yet workable solution.

Features:

  • Allows users to make new listings through an interactive modal prompt.
  • Makes new threads for each listing so buyer/seller conversations can be kept relatively clean.
  • Provides a "/sold" slash command to allow the original poster to close and delete their threads.
  • Keeps the bazaar chats clean through automated cleanup
  • Deploys in a docker container or locally for a fast and easy setup.

Created using

  • Python 3.13.2
  • Discord.py

Setup:

Create a discord bot registration

First, create a Discord bot registration. Instructions to do so are here. When selecting scopes and permissions use the following settings:

  • Scopes: bot
  • Privileged Gateway Intents: Message Content Intent
  • Turn off Public bot

Invite the bot to your server and restrict it from all channels as necessary to prevent interacting with it from outside of the 'Bazaar'.

Create the channels

  1. Create 2 channels, 1 "setup" channel, and 1 "listings" channel. The setup channel will only be used to interact with the bot, the listings channel will contain the sale listing threads.

  2. Setup the permissions of these channels as follows:

    1. For the Setup channel
      1. For normal users:
        • View Channel
        • Send Messages
        • Read Message History
        • Use Application Commands
      2. For the bot account:
        • View Channel
        • Send Messages
        • Manage Messages
        • Read Message History
    2. For the Listings channel
      1. For normal users:
        • View Channel
        • Send Messages in Threads
        • Attach Files
        • Add Reactions
        • Read Message History
        • Use Application Commands
      2. For the bot account:
        • View Channel
        • Send Messages
        • Send Messages in Threads
        • Create Public Threads
        • Embed Links
        • Attach Files
        • Add Reactions
        • Manage Messages
        • Manage Threads
        • Read Message History

Configure the bot

We will assume that you are deploying via Docker container. The same steps apply to a local installtion, but you will need to setup a script as a service or similar mechanism to keep it running.

  1. Setup your .env file. This will contain the environment variables required to connect to discord.
    1. There is a .env.example file for reference.
  2. Deploy the docker container.
    1. Ensure your .env file is mapped into the container with a volume mount, or you provide the required settings as environment variables.
    2. There is an example docker-compose.yml file for reference.

That's it.

Known Issues:

  • Threads are clunky and can cause some data to be left behind when the bot is deleting them. Unfortunately, without proper forums support in private servers this is about the best visual organization we can get.
  • There's currently no automated cleanup for stale threads.
  • Discord interactions have a timeout of 15 minutes or less, which can cause submission errors if users take too long to craft their listing.

About

A simple marketplace bot for discord

Resources

Stars

Watchers

Forks

Languages