GithubHelp home page GithubHelp logo

Comments (2)

Column01 avatar Column01 commented on July 23, 2024

The point of the bot is it's intended for single-server use, you customize it for what you need and then it's good. If you wanted to add a per-server command prefix, you'd need to fundamentally change the code that parses commands to look up the prefix for each guild and verify that the command starts with it. It's not as simple as adding a command module to do it

from discord-moderation-bot.

Column01 avatar Column01 commented on July 23, 2024

The line of code that checks for the prefix is here. You'd also need to store the new prefix lengths alongside the prefix so that this parsing line still works. Then you also need to add a system to save the prefix and prefix length to a storage file. This class is designed for the storage of all the other things the bot needs and could be adapted to do so (already includes things like loading the storage from disk, and saving it to disk), but you need to make sure you don't do things wrong lest you wipe your storage file (see this function where guilds are added for an example of how you need to structure the storage, and see here for an example of getting data from it safely). The storage uses JSON (which is essentially just a python dictionary that gets written to the file as JSON). If you get lost on what the structure really looks at, just compare the guild creation section to a guild in the storage file.

Then once you have all that done, you can make a command to change the prefix in the storage file 😄 Other than that, I can't really help you without just writing the code (which I already kinda did on another canned project. Fun fact, that project is the base I started with when making this bot)

If you have any questions that are related to the specifics of the bot (I.E. how something works specific to the bot), please feel free to post a new issue report.

from discord-moderation-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.