Giter Club home page Giter Club logo

Comments (3)

6days9weeks avatar 6days9weeks commented on September 25, 2024

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 the post_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.

6days9weeks avatar 6days9weeks commented on September 25, 2024

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.

AlaRubra123 avatar AlaRubra123 commented on September 25, 2024

That makes sense to me.

from ban_appeal_plugin.

Related Issues (12)

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.