Comments (3)
https://github.com/kyb3r/modmail/wiki/Plugins#database-interfacing Says:
Do not interact with bot.api directly. Fetch a partition and use it:
Yet, in https://github.com/DjDeveloperr/ban_appeal_plugin/blob/main/ban_appeal/ban_appeal.py#L299
self.bot.api
is directly called for thepost_log
method. Is this not possible to due through the partition?Additionally, that's under the section "Database Interfacing", but I notice
bot.db
is being used directly? Are the interactions there not possible through a partition?I'm not very experienced with Python, nor have I done a deep dive of Modmail's codebase, so if there's something I'm missing here, just let me know.
The reason why Iโm using self.bot.api
instead of a plugin partition is due to adding messages to the logviewer. If you look closely at the modmail code base that method is used to close a thread and send the closed information to the log viewer. The log viewer only checks data for the logs collection, so if I make use of a partition it would lead into another fuckery with internals of modmail and even might need to edit log viewer.
Iโm directly interfacing with bot.db
for a couple of reasons, main one being having all data in the same mongodb database. If I use a plugin partition instead the webserver would need to be edited and changed to follow this partition and iirc changing the plugins class name will result in creating another partition which is I donโt want to go with. By directly working with bot.db
, I could easily access the appeal config collection.
from ban_appeal_plugin.
Let me know if you have any more questions, and apologies if I worded something not well I suck at English sometimes.
from ban_appeal_plugin.
That makes sense to me.
from ban_appeal_plugin.
Related Issues (12)
- License HOT 6
- Connecting to Mongo HOT 1
- Default questions. HOT 2
- Plugin no longer responds to commands after update. HOT 1
- docker run command. HOT 1
- Bot commands not embedded. HOT 1
- Character limit HOT 4
- Command permissions in help text. HOT 1
- Commands in the ban appeal thread show in logviewer. HOT 3
- Bot can create a ban appeal thread it can't view/send messages in HOT 1
- Previous appeal accepted. HOT 2
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 ban_appeal_plugin.