api.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Dwarf 作者: Dwarf-Community 项目源码 文件源码
def new_message(self, message):
        """Creates a new Dwarf ?Message? object and connects it to the database.

        Parameters
        ----------
        message
            Has to be a Discord ?Message? object.
        """

        if isinstance(message, discord.Message):
            return Message(id=message.id, author=message.author.id, channel=message.channel,
                           content=message.content, clean_content=message.clean_content,)
        else:
            raise ValueError("A Message object must be given as an argument")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号