Comments (2)
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.
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)
- How to add a status HOT 10
- Unban Command HOT 1
- Why not @ mentions instead of user id's. HOT 3
- how do i get the @client.command or the @client.event ?
- main.py Not found HOT 3
- cannot import helpers.embed_builder HOT 18
- Mod role isn't recognized as Moderator HOT 10
- Error in console. How to fix? HOT 2
- IS IT PYCORD OR DPY? HOT 2
- Error console HOT 2
- help HOT 8
- Error in console: HOT 3
- AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'? HOT 5
- Hh
- Asking how to start using the bot HOT 9
- Storage explanation HOT 2
- WTF is happening here HOT 3
- why did you not add the ban command? HOT 1
- how to change the prefix HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-moderation-bot.