<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>BLOG</title>
        <link>https://www.336899.xyz/</link>
        <description>一个小站</description>
        <lastBuildDate>Thu, 20 Apr 2023 08:19:41 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2023, smithao</copyright>
        <item>
            <title><![CDATA[加锁文章]]></title>
            <link>https://www.336899.xyz/article/example-2</link>
            <guid>https://www.336899.xyz/article/example-2</guid>
            <pubDate>Fri, 05 Nov 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[本文需要输入密码才可访问，密码: 123456]]></description>
            <content:encoded><![CDATA[本文需要输入密码才可访问，密码: 123456]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ChatGPT接入微信]]></title>
            <link>https://www.336899.xyz/article/invisible</link>
            <guid>https://www.336899.xyz/article/invisible</guid>
            <pubDate>Fri, 05 Nov 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[状态不是Published，故不会被显示]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-2ea732d2721548f5a0ce56f19f1abbd9"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-add19957cffc490da3aa486faa70a46b" data-id="add19957cffc490da3aa486faa70a46b"><span><div id="add19957cffc490da3aa486faa70a46b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#add19957cffc490da3aa486faa70a46b" title="介绍："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">介绍：</span></span></h2><div class="notion-text notion-block-f338d1cf48b844609828940fc3bc844f">基于ChatGPT的微信聊天机器人，接入<span class="notion-orange"><b>ChatGPT API (gpt-3.5-turbo)</b></span>，默认使用该模型进行对话，通过 ChatGPT 接口生成对话内容，使用 itchat 实现微信消息的接收和自动回复。已实现的特性如下：</div><details class="notion-toggle notion-block-a51eb62b13ca4ea380af90781a097081"><summary><b>文本对话：</b> 接<span class="notion-orange"><b>私聊及群组</b></span>中的微信消息，使用ChatGPT生成回复内容，完成自动回复</summary><div></div></details><details class="notion-toggle notion-block-8e7f532a66f4459aa276f2ade7c58b1b"><summary><b>规则定制化：</b> 支持私聊中按指定规则触发自动回复，支持对群组设置自动回复白名单</summary><div></div></details><details class="notion-toggle notion-block-13c4688bbeab4996932de3d27f40d29d"><summary><b>多账号：</b> 支持多微信账号同时运行</summary><div></div></details><details class="notion-toggle notion-block-3864fd7c1c11455ba33baf1690992e04"><summary><b>图片生成：</b> 支持根据描述生成图片，并自动发送至个人聊天或群聊</summary><div></div></details><details class="notion-toggle notion-block-3e7c35f865f0449ab58ffcadda43fdf3"><summary><b>上下文记忆</b>：支持多轮对话记忆，且为每个好友维护独立的上下会话</summary><div></div></details><details class="notion-toggle notion-block-6379312270974dcea5b1dcc26d4be4f9"><summary><b>语音识别：</b>支持接收和处理语音消息，通过文字或语音回复</summary><div></div></details><div class="notion-blank notion-block-51e51dfa762443c9b72841bdfd40dab5"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-ad2746c98188496ba8ce6f6b4b5ecb15" data-id="ad2746c98188496ba8ce6f6b4b5ecb15"><span><div id="ad2746c98188496ba8ce6f6b4b5ecb15" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ad2746c98188496ba8ce6f6b4b5ecb15" title="运行环境："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">运行环境：</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-60f5d7d5f5764b28a8bca49d1ede55d9"><li>支持 Linux、MacOS、Windows 系统（可在Linux服务器上长期运行)，同时需安装Python。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-bc063c79672b423db388e7472c7a7925"><li>建议Python版本在 <span class="notion-orange"><b>3.7.1~3.9.X</b></span> 之间，3.10及以上版本在 MacOS 可用，其他系统上不确定能否正常运行</li></ol><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1b8d48d147ff4c9caad729d24d5a044e" data-id="1b8d48d147ff4c9caad729d24d5a044e"><span><div id="1b8d48d147ff4c9caad729d24d5a044e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1b8d48d147ff4c9caad729d24d5a044e" title="一，环境安装："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一，环境安装：</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-ea9bdff06e3348bf90bde59972455222" data-id="ea9bdff06e3348bf90bde59972455222"><span><div id="ea9bdff06e3348bf90bde59972455222" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ea9bdff06e3348bf90bde59972455222" title="安装方式："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装方式：</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-a8b96487f4bd4261ad1ead6a5321d2db"><li>WINDOWS系统上安装虚拟机，LINUX运行在虚拟机上-需要安装代理软件，如：clash-for-linux；</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-791ef184ad964d6982094f557ee4af71"><li>软路由ESXI系统上安装虚拟机，LINUX运行在虚拟机上-无需代理（软路由已实现）；</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-99e21ff2d63149dab66fafed3bf8cbc8"><li>VPS（国外远程服务器）远程部署安装-无需代理</li></ol><div class="notion-blank notion-block-997bb5c450004e6599a6999c7b036bf3"> </div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-8ff69f4489e84195b3f8aba5e7b9ae6a" data-id="8ff69f4489e84195b3f8aba5e7b9ae6a"><span><div id="8ff69f4489e84195b3f8aba5e7b9ae6a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#8ff69f4489e84195b3f8aba5e7b9ae6a" title="实例1：在Rocky Linux 8/AlmaLinux 8上安装Python 3.9："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">实例1：在Rocky Linux 8/AlmaLinux 8上安装Python 3.9：</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-c5324a58415a465b850e5f736102a0e9"><li>对于新项目和从Python 2.x迁移现有项目，建议使用Python 3。AppStream存储库中提供了不同版本的Python 3包，可以使用以下命令进行检查：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ sudo dnf module list | grep -i python</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-ce9806e9bb58414f9a06b88d23e0b16c"><li>通常情况下，会返回python27、python36、python38、python39选择，如下截图：</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-078c874f9b2b4b5ca776e61d7c02bc46"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F367bbb8e-8284-4672-a67d-eed0c74b79f2%2FUntitled.png?table=block&amp;id=078c874f-9b2b-4b5c-a776-e61d7c02bc46" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="1" class="notion-list notion-list-numbered notion-block-a403b0ef2e1b4561b1ded8de2f3d2e6c"><li>将模块版本传递给dnf命令，例如要安装Python 3.9，运行以下命令：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ sudo dnf install python3.9 -y</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-18d0224c4d8e4a25917a6fed9c02b13e"><li>在系统上安装Python3后，使用下面的命令在交互式shell中使用它：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#检查python3
$ python3.9

Python 3.9.13 (main, Nov 16 2022, 10:51:39)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt;
# 输出上面内容之后，按键盘ctr+d 或ctr+d退出</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-83e12f6077fe47648427c87f8035de48"><li>将Python 3设置为默认值:</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#默认Python 3
$ sudo alternatives --set python /usr/bin/python3

#默认Python 3.9
$ sudo alternatives --set python /usr/bin/python3.9
$ sudo alternatives --set python3 /usr/bin/python3.9</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-bccbe6a335704145b96552862fd6e504"><li>使用此处给出的命令验证您的设置：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ python -V
Python 3.9.13

$ python3 -V
Python 3.9.13</code></pre><div class="notion-text notion-block-4ad13f2f6e4440f3a1374e492afe951b">自此，环境安装完成！直接跳至下面步骤<span class="notion-inline-underscore"><b>二：植入chatgpt-on-wechat项目代码</b></span></div><details class="notion-toggle notion-block-2577ad32d5c64107ad46cb1209d7b562"><summary>以上参考链接：</summary><div><div class="notion-text notion-block-b56c2af94cce4089af9a1f9a5af4f737"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.hmxthome.com/linux/4992.html">https://www.hmxthome.com/linux/4992.html</a></div></div></details><div class="notion-blank notion-block-bf554de9d82e4944bc871e57f456e06d"> </div><div class="notion-blank notion-block-72fb29f4025942978326905192bbaa2d"> </div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-677c3a490d4c425aa5c740ed9711ac91" data-id="677c3a490d4c425aa5c740ed9711ac91"><span><div id="677c3a490d4c425aa5c740ed9711ac91" class="notion-header-anchor"></div><a class="notion-hash-link" href="#677c3a490d4c425aa5c740ed9711ac91" title="实例2：Linux Centos7安装python3.7："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">实例2：Linux Centos7安装python3.7：</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-efc5da6111e1436ba2aaba1b10bb6f76"><li>检查一下原来python的版本和是否有gcc：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">[root@loaclhost ~]# python --version     ##检查python版本
Python 2.7.5                             ##显示版本号
[root@loaclhost ~]# gcc --version        ##检查gcc版本
-bash: gcc: 未找到命令                    ##未安装gcc
[root@loaclhost ~]# yum -y install gcc   ##安装gcc</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-e39faa46ab8c4bae8c524cdc7508aecf"><li>python3.7以上版本，安装依赖包:libffi-devel：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-93b725fb788a43fc8eb5e467a39eee7f"><li>wget下载python3.7.10,  也可以手动下载，下载地址:<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.python.org/downloads/">https://www.python.org/downloads/</a></li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#安装wget
$ yum install wget -y

#wget下载python3.7.10
$ wget https://www.python.org/ftp/python/3.7.10/Python-3.7.10.tgz</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-a15d1023220044c8a7d7ecf645664209"><li>解压下载好的Python安装包：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ tar -zxvf Python-3.7.10.tgz</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-db37f40b80e547ddbc505721e50e4673"><li>进入解压后的目录：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#进入目录
$ cd Python-3.7.10

#创建一个空文件夹，存放python3程序
$ mkdir /usr/local/python3

#指定安装目录
$ ./configure --prefix=/usr/local/python3

#执行完成时提示：&quot;If you want a release build with all stable optimizations active (PGO, etc), please run ./configure --enable-optimizations&quot;
#按提示执行：
$ ./configure --enable-optimization

#编译安装
$ make &amp;&amp; make install</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-699d955397974d6e905f7a044317c37d"><li>建立Python3的软连接：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
$ ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-a5a36626da514c87b39ee67d0bf13b80"><li>检查Python3和pip3：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">[root@loaclhost Python-3.7.10]# python3                             ##检查python3
Python 3.7.10 (default, Mar 16 2022, 11:54:28) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt;

[root@loaclhost Python-3.7.10]# pip3 --version                       ##检查version
pip 22.0.4 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)</code></pre><details class="notion-toggle notion-block-e94f1aafd2bc4044ab6b4b459d4721c6"><summary>以上参考链接：</summary><div><div class="notion-text notion-block-d3e4b076a36549c79a6971af8435fc19">链接：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://blog.csdn.net/fen_fen/article/details/123520752">https://blog.csdn.net/fen_fen/article/details/123520752</a> </div><div class="notion-text notion-block-d0787bc94e634bb7a23e229896509b14">链接：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://zhuanlan.zhihu.com/p/142097087">https://zhuanlan.zhihu.com/p/142097087</a></div></div></details><div class="notion-blank notion-block-8cb2790896944b33bbf9e5fe928e71fd"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-c459f59d8ef346c4860ea0ad10fe8f6b" data-id="c459f59d8ef346c4860ea0ad10fe8f6b"><span><div id="c459f59d8ef346c4860ea0ad10fe8f6b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c459f59d8ef346c4860ea0ad10fe8f6b" title="二，植入chatgpt-on-wechat项目代码:"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二，植入chatgpt-on-wechat项目代码:</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-534de698f1d34701ad4edb32f05ca942"><li>克隆项目代码：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#root目录下克隆项目代码：
$ git clone https://github.com/zhayujie/chatgpt-on-wechat

#如果没有安装git，执行：
$ yum install git -y
</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-071a81b9f50c414a8f61988226104279"><li>安装所需核心依赖：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#进入chatgpt-On-wechat目录：
$ cd chatgpt-on-wechat/

#安装所需核心依赖：
$ pip3 install itchat-uos==1.5.0.dev0
$ pip3 install --upgrade openai

##注：itchat-uos使用指定版本1.5.0.dev0，openai使用最新版本，需高于0.27.0。</code></pre><div class="notion-blank notion-block-00c178b89a4345f4ae311c59d90f6c27"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5930005f7a17463086d180fcf5932b61" data-id="5930005f7a17463086d180fcf5932b61"><span><div id="5930005f7a17463086d180fcf5932b61" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5930005f7a17463086d180fcf5932b61" title="三，配置："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三，配置：</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-53421fa497644e0c8ee95e46fe50feb8"><li>配置文件的模板在根目录的config-template.json中，需复制该模板创建最终生效的 config.json 文件：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript"># 确认在chatgpt-on-wechat目录下，如果没有，输入：
$ cd chatgpt-on-wechat

# 复制json模板，并命名为：config.json
$ cp config-template.json config.json</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-3854fd4de2484cc1bd89d08acc3737e0"><li>然后在config.json中填入配置，以下是对默认配置的说明，可根据需要进行自定义修改：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript"># config.json文件内容示例
{ 
  &quot;open_ai_api_key&quot;: &quot;YOUR API KEY&quot;,                          # 填入上面创建的 OpenAI API KEY, 获取API需要登录：https://platform.openai.com/overview
  &quot;proxy&quot;: &quot;127.0.0.1:7890&quot;,                                  # 代理客户端的ip和端口
  &quot;single_chat_prefix&quot;: [&quot;bot&quot;, &quot;@bot&quot;],                      # 私聊时文本需要包含该前缀才能触发机器人回复
  &quot;single_chat_reply_prefix&quot;: &quot;[bot] &quot;,                       # 私聊时自动回复的前缀，用于区分真人
  &quot;group_chat_prefix&quot;: [&quot;@bot&quot;],                              # 群聊时包含该前缀则会触发机器人回复
  &quot;group_name_white_list&quot;: [&quot;ChatGPT测试群&quot;, &quot;ChatGPT测试群2&quot;], # 开启自动回复的群名称列表
  &quot;image_create_prefix&quot;: [&quot;画&quot;, &quot;看&quot;, &quot;找&quot;],                   # 开启图片回复的前缀
  &quot;conversation_max_tokens&quot;: 1000,                            # 支持上下文记忆的最多字符数
  &quot;voice_reply_voice&quot;: false                                  # 语音识别-关
  &quot;character_desc&quot;: &quot;你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题，并且可以使用多种语言与人交流。&quot;  # 人格描述
}</code></pre><div class="notion-text notion-block-debd32d705bf4678976d7ba5abc226b6">配置说明：</div><details class="notion-toggle notion-block-5745186e3bd744dabafabf7964fd9c1a"><summary>个人聊天:</summary><div><ul class="notion-list notion-list-disc notion-block-241eebca39454dcbab01eda0739894d7"><li>个人聊天中，需要以 &quot;bot&quot;或&quot;@bot&quot; 为开头的内容触发机器人，对应配置项 single_chat_prefix (如果不需要以前缀触发可以填写 &quot;single_chat_prefix&quot;: [&quot;&quot;])</li></ul><ul class="notion-list notion-list-disc notion-block-b268e52470854123a664d8b7b9655940"><li>机器人回复的内容会以 &quot;[bot] &quot; 作为前缀， 以区分真人，对应的配置项为 single_chat_reply_prefix (如果不需要前缀可以填写 &quot;single_chat_reply_prefix&quot;: &quot;&quot;)</li></ul></div></details><details class="notion-toggle notion-block-bb6d3eac0c054eb68623682e8d5e6702"><summary>群组聊天:</summary><div><ul class="notion-list notion-list-disc notion-block-da47beaaf82f44d3b0576743b75ce49c"><li>群组聊天中，群名称需配置在 group_name_white_list 中才能开启群聊自动回复。如果想对所有群聊生效，可以直接填写 &quot;group_name_white_list&quot;: [&quot;ALL_GROUP&quot;]</li></ul><ul class="notion-list notion-list-disc notion-block-b24cb6d08cb248d19aebbc3c8e39e6e0"><li>默认只要被人 @ 就会触发机器人自动回复；另外群聊天中只要检测到以 &quot;@bot&quot; 开头的内容，同样会自动回复（方便自己触发），这对应配置项 group_chat_prefix</li></ul><ul class="notion-list notion-list-disc notion-block-bee91d89204b483591e005019c93e109"><li>可选配置: group_name_keyword_white_list配置项支持模糊匹配群名称，group_chat_keyword配置项则支持模糊匹配群消息内容，用法与上述两个配置项相同。</li></ul></div></details><details class="notion-toggle notion-block-472cd173a3d242ca8ca749e6befdbce9"><summary>其他配置:</summary><div><ul class="notion-list notion-list-disc notion-block-72b34b567a894a33913dd4f8f87e17f7"><li>proxy：由于目前 openai 接口国内无法访问，需配置代理客户端的地址</li></ul><ul class="notion-list notion-list-disc notion-block-cd81e21430a3405cba99197e98c092ac"><li>对于图像生成，在满足个人或群组触发条件外，还需要额外的关键词前缀来触发，对应配置 image_create_prefix</li></ul><ul class="notion-list notion-list-disc notion-block-8af7c26c8c0b4c478b8cef0efe8090ef"><li>关于OpenAI对话及图片接口的参数配置（内容自由度、回复字数限制、图片大小等），可以参考 对话接口 和 图像接口 文档直接在 代码 bot/openai/open_ai_bot.py 中进行调整。</li></ul><ul class="notion-list notion-list-disc notion-block-d2bb4896283e454f9685f27f32927254"><li>conversation_max_tokens：表示能够记忆的上下文最大字数（一问一答为一组对话，如果累积的对话字数超出限制，就会优先移除最早的一组对话）</li></ul><ul class="notion-list notion-list-disc notion-block-2181c59543db4c5aa9a33e23696fd011"><li>character_desc 配置中保存着你对机器人说的一段话，他会记住这段话并作为他的设定，你可以为他定制任何人格</li></ul></div></details><div class="notion-blank notion-block-b12011dfd76b493caa3d8217dc49c864"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-af5aeabf101540c8b03ea3fdb40b52c0" data-id="af5aeabf101540c8b03ea3fdb40b52c0"><span><div id="af5aeabf101540c8b03ea3fdb40b52c0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#af5aeabf101540c8b03ea3fdb40b52c0" title="四，安装代理clash-for-linux代理（需要走代理的话）："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四，安装代理clash-for-linux代理（需要走代理的话）：</span></span></h3><div class="notion-blank notion-block-7c5770cb0bf94c2d9cfdd9a02d286d85"> </div><div class="notion-text notion-block-90873eae51044b4dacadcd0adc824aac">参考链接：</div><div class="notion-blank notion-block-3f27db7f914a4ed3ab1ae9ac42f87e27"> </div><div class="notion-blank notion-block-c918edd63abf4c0497e4f7ff45467bb8"> </div><div class="notion-blank notion-block-96e2cc4f2a9a464f9fa8af636b805616"> </div><div class="notion-blank notion-block-0f554ce3f6264e31931bc29bbea15f11"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-22280f2cca344bd1af4f0bc6c7300758" data-id="22280f2cca344bd1af4f0bc6c7300758"><span><div id="22280f2cca344bd1af4f0bc6c7300758" class="notion-header-anchor"></div><a class="notion-hash-link" href="#22280f2cca344bd1af4f0bc6c7300758" title="五，运行："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">五，运行：</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-9f3ed883f72c4822ba5c140469ba7471"><li>本地运行：如果是开发机 <b>本地运行</b>，直接在<b><span class="notion-inline-underscore">项目根目录</span></b>下执行：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ python3 app.py</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-38d5d17183c947f6a968e22ac089351a"><li>服务器部署：使用nohup命令在后台运行程序：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ touch nohup.out                                   ## 首次运行需要新建日志文件                     
$ nohup python3 app.py &amp; tail -f nohup.out          ## 在后台运行程序并通过日志输出二维码

## 扫码登录后程序即可运行于服务器后台，此时可通过 ctrl+c 关闭日志，不会影响后台程序的运行。
## 使用 ps -ef | grep app.py | grep -v grep 命令可查看运行于后台的进程，
## 如果想要重新启动程序可以先 kill 掉对应的进程。日志关闭后如果想要再次打开只需输入 tail -f nohup.out。 
## scripts/目录有相应的脚本可以调用</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-b151df2d90564b3694744b0e094a83c6"><li>注意：<span class="notion-inline-underscore"><b><span class="notion-orange">务必使用实名认证的微信号，否则无法登录！登陆错误信息见下图，</span></b></span>扫码后手机提示登录验证需要等待5s，</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-899c0b70b8e64a179e66f6e56982cdb9"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:624px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc2d4e1f6-5814-4560-841c-0119595b91f6%2F111.png?table=block&amp;id=899c0b70-b8e6-4a17-9e66-f6e56982cdb9" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="1" class="notion-list notion-list-numbered notion-block-1204d704f3cf42aab9bc2a21da5b82ba"><li>多账号支持： 将项目复制多份，分别启动程序，用不同账号扫码登录即可实现同时运行。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-a58eca1a58de4b90a7e1d7f59a61964c"><li>特殊指令： 用户向机器人发送 #清除记忆 即可清空该用户的上下文记忆。</li></ol><div class="notion-blank notion-block-de9d261f958442758a99549ba62969ab"> </div><div class="notion-text notion-block-34180d5386f948a68624a6e3cd97f181">项目方原链接：<a target="_blank" rel="noopener noreferrer" href="https://github.com/zhayujie/chatgpt-on-wechat" class="notion-external notion-external-mention"><div class="notion-external-image"><svg viewBox="0 0 260 260"><g><path d="M128.00106,0 C57.3172926,0 0,57.3066942 0,128.00106 C0,184.555281 36.6761997,232.535542 87.534937,249.460899 C93.9320223,250.645779 96.280588,246.684165 96.280588,243.303333 C96.280588,240.251045 96.1618878,230.167899 96.106777,219.472176 C60.4967585,227.215235 52.9826207,204.369712 52.9826207,204.369712 C47.1599584,189.574598 38.770408,185.640538 38.770408,185.640538 C27.1568785,177.696113 39.6458206,177.859325 39.6458206,177.859325 C52.4993419,178.762293 59.267365,191.04987 59.267365,191.04987 C70.6837675,210.618423 89.2115753,204.961093 96.5158685,201.690482 C97.6647155,193.417512 100.981959,187.77078 104.642583,184.574357 C76.211799,181.33766 46.324819,170.362144 46.324819,121.315702 C46.324819,107.340889 51.3250588,95.9223682 59.5132437,86.9583937 C58.1842268,83.7344152 53.8029229,70.715562 60.7532354,53.0843636 C60.7532354,53.0843636 71.5019501,49.6441813 95.9626412,66.2049595 C106.172967,63.368876 117.123047,61.9465949 128.00106,61.8978432 C138.879073,61.9465949 149.837632,63.368876 160.067033,66.2049595 C184.49805,49.6441813 195.231926,53.0843636 195.231926,53.0843636 C202.199197,70.715562 197.815773,83.7344152 196.486756,86.9583937 C204.694018,95.9223682 209.660343,107.340889 209.660343,121.315702 C209.660343,170.478725 179.716133,181.303747 151.213281,184.472614 C155.80443,188.444828 159.895342,196.234518 159.895342,208.176593 C159.895342,225.303317 159.746968,239.087361 159.746968,243.303333 C159.746968,246.709601 162.05102,250.70089 168.53925,249.443941 C219.370432,232.499507 256,184.536204 256,128.00106 C256,57.3066942 198.691187,0 128.00106,0 Z M47.9405593,182.340212 C47.6586465,182.976105 46.6581745,183.166873 45.7467277,182.730227 C44.8183235,182.312656 44.2968914,181.445722 44.5978808,180.80771 C44.8734344,180.152739 45.876026,179.97045 46.8023103,180.409216 C47.7328342,180.826786 48.2627451,181.702199 47.9405593,182.340212 Z M54.2367892,187.958254 C53.6263318,188.524199 52.4329723,188.261363 51.6232682,187.366874 C50.7860088,186.474504 50.6291553,185.281144 51.2480912,184.70672 C51.8776254,184.140775 53.0349512,184.405731 53.8743302,185.298101 C54.7115892,186.201069 54.8748019,187.38595 54.2367892,187.958254 Z M58.5562413,195.146347 C57.7719732,195.691096 56.4895886,195.180261 55.6968417,194.042013 C54.9125733,192.903764 54.9125733,191.538713 55.713799,190.991845 C56.5086651,190.444977 57.7719732,190.936735 58.5753181,192.066505 C59.3574669,193.22383 59.3574669,194.58888 58.5562413,195.146347 Z M65.8613592,203.471174 C65.1597571,204.244846 63.6654083,204.03712 62.5716717,202.981538 C61.4524999,201.94927 61.1409122,200.484596 61.8446341,199.710926 C62.5547146,198.935137 64.0575422,199.15346 65.1597571,200.200564 C66.2704506,201.230712 66.6095936,202.705984 65.8613592,203.471174 Z M75.3025151,206.281542 C74.9930474,207.284134 73.553809,207.739857 72.1039724,207.313809 C70.6562556,206.875043 69.7087748,205.700761 70.0012857,204.687571 C70.302275,203.678621 71.7478721,203.20382 73.2083069,203.659543 C74.6539041,204.09619 75.6035048,205.261994 75.3025151,206.281542 Z M86.046947,207.473627 C86.0829806,208.529209 84.8535871,209.404622 83.3316829,209.4237 C81.8013,209.457614 80.563428,208.603398 80.5464708,207.564772 C80.5464708,206.498591 81.7483088,205.631657 83.2786917,205.606221 C84.8005962,205.576546 86.046947,206.424403 86.046947,207.473627 Z M96.6021471,207.069023 C96.7844366,208.099171 95.7267341,209.156872 94.215428,209.438785 C92.7295577,209.710099 91.3539086,209.074206 91.1652603,208.052538 C90.9808515,206.996955 92.0576306,205.939253 93.5413813,205.66582 C95.054807,205.402984 96.4092596,206.021919 96.6021471,207.069023 Z" fill="#161614"></path></g></svg></div><div class="notion-external-description"><div class="notion-external-title">chatgpt-on-wechat</div><div class="notion-external-subtitle"><span>zhayujie</span><span> • </span><span>Updated <!-- -->Apr 20, 2023</span></div></div></a></div><div class="notion-blank notion-block-70e30805163b449aa7bb95776c057f60"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <link>https://www.336899.xyz/article/fbcb1971-52b8-4a75-add2-5c7a6d379080</link>
            <guid>https://www.336899.xyz/article/fbcb1971-52b8-4a75-add2-5c7a6d379080</guid>
            <pubDate>Fri, 02 Jul 2021 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-fbcb197152b84a75add25c7a6d379080"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-3039e26b467a41318f966161c13f8427"><div>文章来源说明</div></blockquote><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-78f8a202031948c3baaf3ba2eac47059" data-id="78f8a202031948c3baaf3ba2eac47059"><span><div id="78f8a202031948c3baaf3ba2eac47059" class="notion-header-anchor"></div><a class="notion-hash-link" href="#78f8a202031948c3baaf3ba2eac47059" title="🤔 一个简单的开头"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">🤔 一个简单的开头</span></span></h2><ol start="1" class="notion-list notion-list-numbered notion-block-403a4b10325842e6ad5dcc0decc09141"><li>问题、目标、人物、背景是什么？</li><ol class="notion-list notion-list-numbered notion-block-403a4b10325842e6ad5dcc0decc09141"><div class="notion-text notion-block-c40d591b573f43efb285ff8df8e17457">为什么读者会对其有兴趣？</div></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-bb535a3a45c0406ea837eba70e534e52"><li>阻碍、努力、结果</li><ol class="notion-list notion-list-numbered notion-block-bb535a3a45c0406ea837eba70e534e52"><div class="notion-text notion-block-fb7ff20605fe45cc9a5d15485e4978ab">展示你的主要成果</div></ol></ol><ol start="3" class="notion-list notion-list-numbered notion-block-33d6d9951c6d4e2786ae08e6da995c4f"><li>意外、转弯</li><ol class="notion-list notion-list-numbered notion-block-33d6d9951c6d4e2786ae08e6da995c4f"><div class="notion-text notion-block-ed74c26b6f4646c2a79b836866c8f10a">说说你的故事</div></ol></ol><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-970fb37ce1f6488399cc99ecb5eddc60" data-id="970fb37ce1f6488399cc99ecb5eddc60"><span><div id="970fb37ce1f6488399cc99ecb5eddc60" class="notion-header-anchor"></div><a class="notion-hash-link" href="#970fb37ce1f6488399cc99ecb5eddc60" title="📝主旨内容"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">📝主旨内容</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5ce83e9990ff4216a499fdf5ee87808d" data-id="5ce83e9990ff4216a499fdf5ee87808d"><span><div id="5ce83e9990ff4216a499fdf5ee87808d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5ce83e9990ff4216a499fdf5ee87808d" title="观点1"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">观点1</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5304e4d2107c45128b22f95530107791" data-id="5304e4d2107c45128b22f95530107791"><span><div id="5304e4d2107c45128b22f95530107791" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5304e4d2107c45128b22f95530107791" title="观点2"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">观点2</span></span></h3><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1cdb6605b35a4acc89984736300ff395" data-id="1cdb6605b35a4acc89984736300ff395"><span><div id="1cdb6605b35a4acc89984736300ff395" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1cdb6605b35a4acc89984736300ff395" title="🤗总结归纳"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">🤗总结归纳</span></span></h2><div class="notion-blank notion-block-0253774a261d4ec4b77aa18b4c0796ee"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-eea47dd9fff443b2be05ae5f9d228307" data-id="eea47dd9fff443b2be05ae5f9d228307"><span><div id="eea47dd9fff443b2be05ae5f9d228307" class="notion-header-anchor"></div><a class="notion-hash-link" href="#eea47dd9fff443b2be05ae5f9d228307" title="参考文章"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">参考文章</span></span></h2><div class="notion-blank notion-block-597c2bb1b55f41cfaa3eb1e9ebe78156"> </div><div class="notion-blank notion-block-d350dd820a774050a1849588d9491a5b"> </div><div class="notion-text notion-block-af3e8d6c4d4d49a1b13ad0aa31d218c0">致谢：</div><div class="notion-callout notion-gray_background_co notion-block-9c4e827bb17547f4b39f77c5d3633208"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">有关Notion安装或者使用上的问题，欢迎您在底部评论区留言，一起交流~</div></div><div class="notion-blank notion-block-5636f5824868483ca680330c4bf5ba84"> </div><div class="notion-blank notion-block-c4c8928a5e4d43eea2ac0c363b06b706"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[示例文章]]></title>
            <link>https://www.336899.xyz/article/example-1</link>
            <guid>https://www.336899.xyz/article/example-1</guid>
            <pubDate>Fri, 05 Nov 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[这是示例的文章摘要，摘要内容可被用做搜索，预览。文章列表默认展示概要；若要在列表直接展示文章内容，可在blog.config.js中配置。]]></description>
            <content:encoded><![CDATA[<div id="container" class="mx-auto undefined"><main class="notion light-mode notion-page notion-block-b19e2e35b26142ec960b6d7b536381a4"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-4074e85f5bdd404394a25453f240fd6c" data-id="4074e85f5bdd404394a25453f240fd6c"><span><div id="4074e85f5bdd404394a25453f240fd6c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4074e85f5bdd404394a25453f240fd6c" title="基本段落"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">基本段落</span></span></h2><blockquote class="notion-quote notion-block-e9b6a368f72b435e85eb25e605d826b3"><div>书中自有黄金屋，书中自有颜如玉</div></blockquote><div class="notion-callout notion-gray_background_co notion-block-56337c7d28d1442bb27bf1fff3c5a17e"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">生活的意义并不是与他人争高下，而在于享受努力实现目标的过程，结果只是对自己行动的嘉奖。</div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-57cd02cd8eca4b4f817f0fb15c34a2d7" data-id="57cd02cd8eca4b4f817f0fb15c34a2d7"><span><div id="57cd02cd8eca4b4f817f0fb15c34a2d7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#57cd02cd8eca4b4f817f0fb15c34a2d7" title="将进酒"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>将进酒</b></span></span></h3><div class="notion-text notion-block-2e1d42067a9b409a9b08a5e4abf58c71">李白〔唐代〕</div><div class="notion-text notion-block-eaea36d09a6b474480bfef4704d50c2a">君不见黄河之水天上来，奔流到海不复回。
君不见高堂明镜悲白发，朝如青丝暮成雪。
人生得意须尽欢，莫使金樽空对月。
天生我材必有用，千金散尽还复来。
烹羊宰牛且为乐，会须一饮三百杯。
岑夫子，丹丘生，将进酒，杯莫停。
与君歌一曲，请君为我倾耳听。
钟鼓馔玉不足贵，但愿长醉不愿醒。
古来圣贤皆寂寞，惟有饮者留其名。
陈王昔时宴平乐，斗酒十千恣欢谑。
主人何为言少钱，径须沽取对君酌。
五花马、千金裘，呼儿将出换美酒，与尔同销万古愁。</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-19a631c5b3da41f0b0170b71c005f027" href="https://tangly1024.com/"><div><div class="notion-bookmark-title">TANGLY&#x27;s BLOG | 记录思考、分享我的学习笔记</div><div class="notion-bookmark-description">记录思考、分享我的学习笔记</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://tangly1024.com/favicon.ico" alt="TANGLY&#x27;s BLOG | 记录思考、分享我的学习笔记" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://tangly1024.com/</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://images.unsplash.com/photo-1564419320603-628d868a193f?q=50&amp;fm=jpg&amp;fit=crop&amp;w=1920&amp;h=1600" alt="TANGLY&#x27;s BLOG | 记录思考、分享我的学习笔记" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-80539fff5ed3475c8501cbbf9d248060"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-30304ebcaa024a6b93a245ddbe1151ca" data-id="30304ebcaa024a6b93a245ddbe1151ca"><span><div id="30304ebcaa024a6b93a245ddbe1151ca" class="notion-header-anchor"></div><a class="notion-hash-link" href="#30304ebcaa024a6b93a245ddbe1151ca" title="特殊段落"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">特殊段落</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1c82a6d7638241ad9639fa9c2a69988f" data-id="1c82a6d7638241ad9639fa9c2a69988f"><span><div id="1c82a6d7638241ad9639fa9c2a69988f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1c82a6d7638241ad9639fa9c2a69988f" title="1.代码"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.代码</span></span></h3><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-bash"># Bash 安装zsh
$ sudo apt install zsh

# 配置ohmyzsh
$ sh -c &quot;$(curl -fsSL &lt;https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh&gt;)&quot;

# 配置ohmyzsh插件
# zsh-autosuggestions
$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

# zsh-syntax-highlighting
$ git clone &lt;https://github.com/zsh-users/zsh-syntax-highlighting.git&gt; ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

// 启用插件
$ vim .zshrc
plugins=(git z zsh-autosuggestions zsh-syntax-highlighting)</code></pre><details class="notion-toggle notion-block-2c713dfdc6af45e3be5398155227b291"><summary>其他更多语言</summary><div><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-bash">ps -ef | grep java | awk &#x27;{print $2}&#x27; | xargs kill -9</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-java">@Test
public void test11() {

  long start = System.currentTimeMillis();
  int a = 0;
  for(int i=0;i&lt;1000000000;i++){
      try {
          a++;
      }catch (Exception e){
          e.printStackTrace();
      }
  }
  long useTime = System.currentTimeMillis()-start;
  System.out.println(&quot;useTime:&quot;+useTime);
}</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-python">#!/usr/bin/python3
import json
 
# Python 字典类型转换为 JSON 对象
data = {
    &#x27;no&#x27; : 1,
    &#x27;name&#x27; : &#x27;hello&#x27;,
    &#x27;url&#x27; : &#x27;http://tangly1024.com&#x27;
}
 
json_str = json.dumps(data)
print (&quot;Python 原始数据：&quot;, repr(data))
print (&quot;JSON 对象：&quot;, json_str)</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-r"># R 语言
#file.edit(path.expand(file.path(&quot;~&quot;, &quot;.Renviron&quot;)))
library(telegram.bot)
library(stringr)
# Initiate the bot session using the token from the enviroment variable.
bot = Bot(token = bot_token(&#x27;your_bot&#x27;))
usr_list &lt;- c(12344566, 12345566)</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-css">html {
	background-color: red;
}</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;
 
// main() 是程序开始执行的地方
 
int main()
{
   cout &lt;&lt; &quot;Hello World&quot;; // 输出 Hello World
   return 0;
}</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-csharp">using System;
namespace HelloWorldApplication
{
   class HelloWorld
   {
      static void Main(string[] args)
      {
         Console.WriteLine(&quot;Hello World&quot;);
         Console.ReadKey();
      }
   }
}</code></pre><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-asm6502">.section __TEXT,__text,regular,pure_instructions
.macosx_version_min 10, 13
.globl _add_a_b
.p2align 4, 0x90
_add_a_b: ## @add_a_b
.cfi_startproc
## BB#0:
pushq %rbp
Lcfi0:
.cfi_def_cfa_offset 16
Lcfi1:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Lcfi2:
.cfi_def_cfa_register %rbp
movl %edi, -4(%rbp)
movl %esi, -8(%rbp)
movl -4(%rbp), %esi
addl -8(%rbp), %esi
movl %esi, %eax
popq %rbp
retq
.cfi_endproc

.globl _main
.p2align 4, 0x90
_main: ## @main
.cfi_startproc
## BB#0:
pushq %rbp
Lcfi3:
.cfi_def_cfa_offset 16
Lcfi4:
.cfi_offset %rbp, -16
movq %rsp, %rbp
Lcfi5:
.cfi_def_cfa_register %rbp
subq $16, %rsp
movl $1, %edi
movl $2, %esi
movl $0, -4(%rbp)
callq _add_a_b
addq $16, %rsp
popq %rbp
retq
.cfi_endproc</code></pre></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-c9ff7e10fef444ff93475b102bd1bdb0" data-id="c9ff7e10fef444ff93475b102bd1bdb0"><span><div id="c9ff7e10fef444ff93475b102bd1bdb0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c9ff7e10fef444ff93475b102bd1bdb0" title="2.公式"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.公式</span></span></h3><ul class="notion-list notion-list-disc notion-block-150f9b46384846e68f953e148a50f50d"><li>数学公式</li><ul class="notion-list notion-list-disc notion-block-150f9b46384846e68f953e148a50f50d"><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span></ul></ul><ul class="notion-list notion-list-disc notion-block-6c3e901961fc417e8d02846903e748e0"><li>化学方程</li><ul class="notion-list notion-list-disc notion-block-6c3e901961fc417e8d02846903e748e0"><div class="notion-text notion-block-9e422e03275641be82b961254a083033"><span role="button" tabindex="0" class="notion-equation notion-equation-inline"><span></span></span></div></ul></ul><details class="notion-toggle notion-block-3c719c48fece43b782320595135d516c"><summary>其他更多公式</summary><div><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span><div class="notion-blank notion-block-bf2bedce49104020b634eaa1719b49de"> </div><span role="button" tabindex="0" class="notion-equation notion-equation-block"><span></span></span></div></details><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-6d37b18b910d442d8efcfa6f5949fcbd" data-id="6d37b18b910d442d8efcfa6f5949fcbd"><span><div id="6d37b18b910d442d8efcfa6f5949fcbd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6d37b18b910d442d8efcfa6f5949fcbd" title="3. 图表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3. 图表</span></span></h3><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-mermaid">graph LR;
公司架构--&gt;商务
公司架构--&gt;研发
公司架构--&gt;设计
公司架构--&gt;运营
公司架构--&gt;产品</code></pre><figcaption class="notion-asset-caption">思维导图</figcaption><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-53afded5ae36427c8caf8f05a33b78a7" data-id="53afded5ae36427c8caf8f05a33b78a7"><span><div id="53afded5ae36427c8caf8f05a33b78a7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#53afded5ae36427c8caf8f05a33b78a7" title="4. PDF嵌入"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4. PDF嵌入</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-pdf notion-block-8515914479cd4ce7884350ecffab5bbe"><div style="position:relative;display:block;justify-content:center;align-self:center;width:708px;max-width:100%;flex-direction:column;height:320px;overflow:auto;background:rgb(226, 226, 226);padding:8px 16px"></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-6ff1e9ed4df349bab1cd292ad4d64bd2" data-id="6ff1e9ed4df349bab1cd292ad4d64bd2"><span><div id="6ff1e9ed4df349bab1cd292ad4d64bd2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6ff1e9ed4df349bab1cd292ad4d64bd2" title="5.下载附件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.下载附件</span></span></h3><div class="notion-file notion-block-22caa6216d444b75a68b663c9b2cd479"><a target="_blank" rel="noopener noreferrer" class="notion-file-link" href="https://file.notion.so/f/s/fab11580-96c3-4230-90f6-05257f00fb0a/%E6%B5%8B%E8%AF%95%E5%B5%8C%E5%85%A5PDF.pdf?id=22caa621-6d44-4b75-a68b-663c9b2cd479&amp;table=block&amp;spaceId=138a94ec-6abd-45fd-ab78-404c6851a9e4&amp;expirationTimestamp=1682065181916&amp;signature=8_PPpHig3SVWI4_WuOLCrzicdjzQCEgOM8kUk0eIn3U"><svg class="notion-file-icon" viewBox="0 0 30 30"><path d="M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z"></path></svg><div class="notion-file-info"><div class="notion-file-title">下载PDF附件.pdf</div><div class="notion-file-size">469.5KB</div></div></a></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5bdfa20f90f04261bed63e710a93b0c7" data-id="5bdfa20f90f04261bed63e710a93b0c7"><span><div id="5bdfa20f90f04261bed63e710a93b0c7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5bdfa20f90f04261bed63e710a93b0c7" title="6. 照片集"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6. 照片集</span></span></h3><div><div></div><div class="notion-collection-header"><div class="notion-collection-header-title">照片集</div></div></div><div class="notion-collection notion-block-6ce0406c90f043ee9b8c7e4935a77d8d"><div class="notion-gallery"><div class="notion-gallery-view"><div class="notion-gallery-grid notion-gallery-grid-size-large"><a class="notion-collection-card notion-collection-card-size-large" href="/23c1970383de42e38caf9f5c111e68fa"><div class="notion-collection-card-cover"><img style="object-fit:cover;object-position:center 30.000000000000004%" src="https://www.notion.so/images/page-cover/met_emanuel_leutze.jpg" alt="照片标题1" loading="lazy" decoding="async"/></div><div class="notion-collection-card-body"><div class="notion-collection-card-property"><span class="notion-property notion-property-title"><span class="notion-page-link"><span class="notion-page-title"><div class="notion-page-icon-inline notion-page-icon-image"><svg class="notion-page-title-icon notion-page-icon" alt="照片标题1" viewBox="0 0 30 30" width="16"><path d="M16,1H4v28h22V11L16,1z M16,3.828L23.172,11H16V3.828z M24,27H6V3h8v10h10V27z M8,17h14v-2H8V17z M8,21h14v-2H8V21z M8,25h14v-2H8V25z"></path></svg></div><span class="notion-page-title-text">照片标题1</span></span></span></span></div><div class="notion-collection-card-property"><span class="notion-property notion-property-text"><form action="https://preview.tangly1024.com/fc758ffac897479d9a7161cce3272520" target="_blank"><input type="submit" class="nested-form-link notion-link" value="查看"/></form></span></div></div></a><a class="notion-collection-card notion-collection-card-size-large" href="/9e87f566183a454cb2f95209be4c8a00"><div class="notion-collection-card-cover"><img style="object-fit:cover;object-position:center 100%" src="https://www.notion.so/images/page-cover/woodcuts_5.jpg" alt="照片标题3" loading="lazy" decoding="async"/></div><div class="notion-collection-card-body"><div class="notion-collection-card-property"><span class="notion-property notion-property-title"><span class="notion-page-link"><span class="notion-page-title"><div class="notion-page-icon-inline notion-page-icon-image"><svg class="notion-page-title-icon notion-page-icon" alt="照片标题3" viewBox="0 0 30 30" width="16"><path d="M16,1H4v28h22V11L16,1z M16,3.828L23.172,11H16V3.828z M24,27H6V3h8v10h10V27z M8,17h14v-2H8V17z M8,21h14v-2H8V21z M8,25h14v-2H8V25z"></path></svg></div><span class="notion-page-title-text">照片标题3</span></span></span></span></div><div class="notion-collection-card-property"><span class="notion-property notion-property-text"><form action="https://tangly1024.com/" target="_blank"><input type="submit" class="nested-form-link notion-link" value="https://tangly1024.com/"/></form></span></div></div></a></div></div></div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-85d3df2bb11349638e843f8ab098b8de" data-id="85d3df2bb11349638e843f8ab098b8de"><span><div id="85d3df2bb11349638e843f8ab098b8de" class="notion-header-anchor"></div><a class="notion-hash-link" href="#85d3df2bb11349638e843f8ab098b8de" title="7. 内嵌网页"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7. 内嵌网页</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-embed notion-block-6d158a8414014344a6ab35a37217545b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:486.99713134765625px"><iframe class="notion-asset-object-fit" src="https://docs.tangly1024.com/zh" title="iframe embed" frameBorder="0" allowfullscreen="" loading="lazy" scrolling="auto"></iframe></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-03ca76f11a6f4c9d9568dd15b2804339" data-id="03ca76f11a6f4c9d9568dd15b2804339"><span><div id="03ca76f11a6f4c9d9568dd15b2804339" class="notion-header-anchor"></div><a class="notion-hash-link" href="#03ca76f11a6f4c9d9568dd15b2804339" title="5.代办"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.代办</span></span></h3><div class="notion-row notion-block-188c9a4677c24b7a9f4675e67fd75b40"><div class="notion-column notion-block-77c64cb08957447caef390eba80e91e7" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><div class="notion-text notion-teal_background notion-block-4978af85c6454d4a83b4121eb3f29f9c">家庭</div><div class="notion-to-do notion-block-f9232d22cd894fc094e216dcafd824dd"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">洗衣</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-3885297eff534c4097500d8cc6a1f083"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">做饭</div></div><div class="notion-to-do-children"></div></div></div><div class="notion-spacer"></div><div class="notion-column notion-block-d1dc2d42532e40d9ae442944fe37f1d5" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><div class="notion-text notion-blue_background notion-block-2d44123327d442e8ab4a169b46d88bf8">事业</div><div class="notion-to-do notion-block-b3f1e72c4db840fc9ed0728371b9629e"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">开会</div></div><div class="notion-to-do-children"></div></div><div class="notion-to-do notion-block-c6fcea82233d40a299843906045fab58"><div class="notion-to-do-item"><span class="notion-property notion-property-checkbox"><div class="notion-property-checkbox-unchecked"></div></span><div class="notion-to-do-body">加班</div></div><div class="notion-to-do-children"></div></div></div><div class="notion-spacer"></div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a8803b0747164dcd9790dce1bfacc2bd" data-id="a8803b0747164dcd9790dce1bfacc2bd"><span><div id="a8803b0747164dcd9790dce1bfacc2bd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a8803b0747164dcd9790dce1bfacc2bd" title="6.折叠列表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.折叠列表</span></span></h3><details class="notion-toggle notion-block-6ff786c3f934454e9ae6ff0b50ddd181"><summary>点击展开</summary><div><details class="notion-toggle notion-block-1c881fb4e0e740649ddb8c27b1d2ab1f"><summary>点击展开</summary><div><details class="notion-toggle notion-block-7948cbd99a0c41e38a146544ec9ad8b3"><summary>点击展开</summary><div><div class="notion-text notion-block-52c6df24d7344cf8a4f0cd0bf45229f1">内容可以多级嵌套</div></div></details></div></details></div></details><hr class="notion-hr notion-block-9188e1165b23405f8ef9a7b945ea524a"/><div class="notion-blank notion-block-6a084075aaad4b8f8c318edc891ef3f0"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-088812657afc44e39cd75eeae3676ace" data-id="088812657afc44e39cd75eeae3676ace"><span><div id="088812657afc44e39cd75eeae3676ace" class="notion-header-anchor"></div><a class="notion-hash-link" href="#088812657afc44e39cd75eeae3676ace" title="8. 同步块 "><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">8. 同步块 </span></span></h3><div class="notion-text notion-block-5435f7ef4f394a0ca45cd44958889ef6">Notion支持将不同页面的块进行同步，即 SyncBlock，以下是来自另一个页面的块：</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-775c33547c8b46439be96a1b6e39023d" data-id="775c33547c8b46439be96a1b6e39023d"><span><div id="775c33547c8b46439be96a1b6e39023d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#775c33547c8b46439be96a1b6e39023d" title="介绍："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">介绍：</span></span></h2><div class="notion-text notion-block-ccecd4141cd24c6a82ff95eb78472ed6">基于ChatGPT的微信聊天机器人，接入<span class="notion-orange"><b>ChatGPT API (gpt-3.5-turbo)</b></span>，默认使用该模型进行对话，通过 ChatGPT 接口生成对话内容，使用 itchat 实现微信消息的接收和自动回复。已实现的特性如下：</div><details class="notion-toggle notion-block-368a85b6312d48d29d57ec0482771d5e"><summary><b>文本对话：</b> 接<span class="notion-orange"><b>私聊及群组</b></span>中的微信消息，使用ChatGPT生成回复内容，完成自动回复</summary><div></div></details><details class="notion-toggle notion-block-fd754d28204745c6afe6b0c8210dff03"><summary><b>规则定制化：</b> 支持私聊中按指定规则触发自动回复，支持对群组设置自动回复白名单</summary><div></div></details><details class="notion-toggle notion-block-8d96358293014a70abf72ef3ad6d98be"><summary><b>多账号：</b> 支持多微信账号同时运行</summary><div></div></details><details class="notion-toggle notion-block-505ed694365f453c8b5a05f93102448f"><summary><b>图片生成：</b> 支持根据描述生成图片，并自动发送至个人聊天或群聊</summary><div></div></details><details class="notion-toggle notion-block-abec0ed743ca471e9c6bc3c6ed646f28"><summary><b>上下文记忆</b>：支持多轮对话记忆，且为每个好友维护独立的上下会话</summary><div></div></details><details class="notion-toggle notion-block-5531d100a14946a0a0b834c1eccc46da"><summary><b>语音识别：</b>支持接收和处理语音消息，通过文字或语音回复</summary><div></div></details><div class="notion-blank notion-block-a5e991cbe3634f9197bc94c1d7ab0411"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-3e041c9620314df1ac1066c39d8ac06d" data-id="3e041c9620314df1ac1066c39d8ac06d"><span><div id="3e041c9620314df1ac1066c39d8ac06d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3e041c9620314df1ac1066c39d8ac06d" title="运行环境："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">运行环境：</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-735691e8d6ad4ae49a4455eb2744ba43"><li>支持 Linux、MacOS、Windows 系统（可在Linux服务器上长期运行)，同时需安装Python。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-aa28b75458674f2984dc6ac363089306"><li>建议Python版本在 <span class="notion-orange"><b>3.7.1~3.9.X</b></span> 之间，3.10及以上版本在 MacOS 可用，其他系统上不确定能否正常运行</li></ol><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-15eef20b11d94876886ffa8aff82aa93" data-id="15eef20b11d94876886ffa8aff82aa93"><span><div id="15eef20b11d94876886ffa8aff82aa93" class="notion-header-anchor"></div><a class="notion-hash-link" href="#15eef20b11d94876886ffa8aff82aa93" title="一，环境安装："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一，环境安装：</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-617f970f5caa417b9dbfc8b110813c30" data-id="617f970f5caa417b9dbfc8b110813c30"><span><div id="617f970f5caa417b9dbfc8b110813c30" class="notion-header-anchor"></div><a class="notion-hash-link" href="#617f970f5caa417b9dbfc8b110813c30" title="安装方式："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">安装方式：</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-54087336117f418898f94bf24373f859"><li>WINDOWS系统上安装虚拟机，LINUX运行在虚拟机上-需要安装代理软件，如：clash-for-linux；</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-b82e8a8444ee46a2bb11793c9ae19ede"><li>软路由ESXI系统上安装虚拟机，LINUX运行在虚拟机上-无需代理（软路由已实现）；</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-c9e3cbbc9567437f8e0b36ee316d5bf0"><li>VPS（国外远程服务器）远程部署安装-无需代理</li></ol><div class="notion-blank notion-block-1c46b677a4a946a8a8a7b629b0fc908f"> </div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-9c7edff4023546e5a243b5b9f7a2c587" data-id="9c7edff4023546e5a243b5b9f7a2c587"><span><div id="9c7edff4023546e5a243b5b9f7a2c587" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9c7edff4023546e5a243b5b9f7a2c587" title="实例1：在Rocky Linux 8/AlmaLinux 8上安装Python 3.9："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">实例1：在Rocky Linux 8/AlmaLinux 8上安装Python 3.9：</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-b56196ec7571461891e5d99da9905dc3"><li>对于新项目和从Python 2.x迁移现有项目，建议使用Python 3。AppStream存储库中提供了不同版本的Python 3包，可以使用以下命令进行检查：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ sudo dnf module list | grep -i python</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-a456c12b19fa4f5ea11724ce6f484223"><li>通常情况下，会返回python27、python36、python38、python39选择，如下截图：</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5b0f69dfe59044ee9bec72fb7f08c314"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.hmxthome.com/picture/23/1-230121154251628.JPG" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="1" class="notion-list notion-list-numbered notion-block-aab92360de38414ab598da39a454151f"><li>将模块版本传递给dnf命令，例如要安装Python 3.9，运行以下命令：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ sudo dnf install python3.9 -y</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-a5cf9b99b8134e55b080df227a03287c"><li>在系统上安装Python3后，使用下面的命令在交互式shell中使用它：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#检查python3
$ python3.9

Python 3.9.13 (main, Nov 16 2022, 10:51:39)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt;
# 输出上面内容之后，按键盘ctr+d 或ctr+d退出</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-946b79d9e1a14aada702c212a985cfb3"><li>将Python 3设置为默认值:</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#默认Python 3
$ sudo alternatives --set python /usr/bin/python3

#默认Python 3.9
$ sudo alternatives --set python /usr/bin/python3.9
$ sudo alternatives --set python3 /usr/bin/python3.9</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-163ee38bff4f46a5b0c2fc56a0093754"><li>使用此处给出的命令验证您的设置：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ python -V
Python 3.9.13

$ python3 -V
Python 3.9.13</code></pre><div class="notion-text notion-block-419018a8b8a547a9abfa37dae9c91e0a">自此，环境安装完成！直接跳至下面步骤<span class="notion-inline-underscore"><b>二：植入chatgpt-on-wechat项目代码</b></span></div><details class="notion-toggle notion-block-80e428469f0a4f7a9d1cd762334ae0ba"><summary>以上参考链接：</summary><div><div class="notion-text notion-block-710ae055b2d94595a40eddf0d591548f"><a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.hmxthome.com/linux/4992.html">https://www.hmxthome.com/linux/4992.html</a></div></div></details><div class="notion-blank notion-block-44cd6b6481e54104929210aa7079266d"> </div><div class="notion-blank notion-block-33ae8397d373472482e08f3839650962"> </div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-538e650fe8174c80b96186fbfccb0524" data-id="538e650fe8174c80b96186fbfccb0524"><span><div id="538e650fe8174c80b96186fbfccb0524" class="notion-header-anchor"></div><a class="notion-hash-link" href="#538e650fe8174c80b96186fbfccb0524" title="实例2：Linux Centos7安装python3.7："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">实例2：Linux Centos7安装python3.7：</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-a8c377f0651d44738c7377e39dd69326"><li>检查一下原来python的版本和是否有gcc：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">[root@loaclhost ~]# python --version     ##检查python版本
Python 2.7.5                             ##显示版本号
[root@loaclhost ~]# gcc --version        ##检查gcc版本
-bash: gcc: 未找到命令                    ##未安装gcc
[root@loaclhost ~]# yum -y install gcc   ##安装gcc</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-330b29c3bf404eddb1e9c45b163dbe20"><li>python3.7以上版本，安装依赖包:libffi-devel：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-8428e9f151a14fd59a0eead0f75e25bd"><li>wget下载python3.7.10,  也可以手动下载，下载地址:<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://www.python.org/downloads/">https://www.python.org/downloads/</a></li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#安装wget
$ yum install wget -y

#wget下载python3.7.10
$ wget https://www.python.org/ftp/python/3.7.10/Python-3.7.10.tgz</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-1d0edd80ed5045149a7e304b8eef1887"><li>解压下载好的Python安装包：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ tar -zxvf Python-3.7.10.tgz</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-d86b229cb23c4d18b3f57bbff6253206"><li>进入解压后的目录：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#进入目录
$ cd Python-3.7.10

#创建一个空文件夹，存放python3程序
$ mkdir /usr/local/python3

#指定安装目录
$ ./configure --prefix=/usr/local/python3

#执行完成时提示：&quot;If you want a release build with all stable optimizations active (PGO, etc), please run ./configure --enable-optimizations&quot;
#按提示执行：
$ ./configure --enable-optimization

#编译安装
$ make &amp;&amp; make install</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-274acb3852f24383a477ff948f04fa6f"><li>建立Python3的软连接：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
$ ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-1e23de39ec574bb5a8775f3656959167"><li>检查Python3和pip3：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">[root@loaclhost Python-3.7.10]# python3                             ##检查python3
Python 3.7.10 (default, Mar 16 2022, 11:54:28) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt;

[root@loaclhost Python-3.7.10]# pip3 --version                       ##检查version
pip 22.0.4 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)</code></pre><details class="notion-toggle notion-block-3c6e4c9e52a64d0a9a958e88c808d8b0"><summary>以上参考链接：</summary><div><div class="notion-text notion-block-c343806a9b6944518a480a43a253ed4c">链接：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://blog.csdn.net/fen_fen/article/details/123520752">https://blog.csdn.net/fen_fen/article/details/123520752</a> </div><div class="notion-text notion-block-92f489cdd8d04d29a942f770cb8a8d2f">链接：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://zhuanlan.zhihu.com/p/142097087">https://zhuanlan.zhihu.com/p/142097087</a></div></div></details><div class="notion-blank notion-block-9cc10542ac27443f8debb956a290b4b1"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-1f2de16ae00846deb0c2a6d58d5d958e" data-id="1f2de16ae00846deb0c2a6d58d5d958e"><span><div id="1f2de16ae00846deb0c2a6d58d5d958e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1f2de16ae00846deb0c2a6d58d5d958e" title="二，植入chatgpt-on-wechat项目代码:"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二，植入chatgpt-on-wechat项目代码:</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-a9476bf3909f457da25fd6c064fbe33f"><li>克隆项目代码：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#root目录下克隆项目代码：
$ git clone https://github.com/zhayujie/chatgpt-on-wechat

#如果没有安装git，执行：
$ yum install git -y
</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-5d8ba29f59f54e4ba34037e365ced182"><li>安装所需核心依赖：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">#进入chatgpt-On-wechat目录：
$ cd chatgpt-on-wechat/

#安装所需核心依赖：
$ pip3 install itchat-uos==1.5.0.dev0
$ pip3 install --upgrade openai

##注：itchat-uos使用指定版本1.5.0.dev0，openai使用最新版本，需高于0.27.0。</code></pre><div class="notion-blank notion-block-a6a7d5da7ade492fbf27ea7b0e9abeac"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-9d3184887cc0442b9d5642aa4eadbb66" data-id="9d3184887cc0442b9d5642aa4eadbb66"><span><div id="9d3184887cc0442b9d5642aa4eadbb66" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9d3184887cc0442b9d5642aa4eadbb66" title="三，配置："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三，配置：</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-0028ca621e814f4e9063a338a614b98b"><li>配置文件的模板在根目录的config-template.json中，需复制该模板创建最终生效的 config.json 文件：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript"># 确认在chatgpt-on-wechat目录下，如果没有，输入：
$ cd chatgpt-on-wechat

# 复制json模板，并命名为：config.json
$ cp config-template.json config.json</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-38515ddc8f76443e879680b2cba10e61"><li>然后在config.json中填入配置，以下是对默认配置的说明，可根据需要进行自定义修改：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript"># config.json文件内容示例
{ 
  &quot;open_ai_api_key&quot;: &quot;YOUR API KEY&quot;,                          # 填入上面创建的 OpenAI API KEY, 获取API需要登录：https://platform.openai.com/overview
  &quot;proxy&quot;: &quot;127.0.0.1:7890&quot;,                                  # 代理客户端的ip和端口
  &quot;single_chat_prefix&quot;: [&quot;bot&quot;, &quot;@bot&quot;],                      # 私聊时文本需要包含该前缀才能触发机器人回复
  &quot;single_chat_reply_prefix&quot;: &quot;[bot] &quot;,                       # 私聊时自动回复的前缀，用于区分真人
  &quot;group_chat_prefix&quot;: [&quot;@bot&quot;],                              # 群聊时包含该前缀则会触发机器人回复
  &quot;group_name_white_list&quot;: [&quot;ChatGPT测试群&quot;, &quot;ChatGPT测试群2&quot;], # 开启自动回复的群名称列表
  &quot;image_create_prefix&quot;: [&quot;画&quot;, &quot;看&quot;, &quot;找&quot;],                   # 开启图片回复的前缀
  &quot;conversation_max_tokens&quot;: 1000,                            # 支持上下文记忆的最多字符数
  &quot;voice_reply_voice&quot;: false                                  # 语音识别-关
  &quot;character_desc&quot;: &quot;你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题，并且可以使用多种语言与人交流。&quot;  # 人格描述
}</code></pre><div class="notion-text notion-block-ff66f024072143c59a24bfa9e47b8af5">配置说明：</div><details class="notion-toggle notion-block-3431558baf4d4deca33e179a7cd129c7"><summary>个人聊天:</summary><div><ul class="notion-list notion-list-disc notion-block-c34dc63f02764a1bb9e7fdf2d5d54439"><li>个人聊天中，需要以 &quot;bot&quot;或&quot;@bot&quot; 为开头的内容触发机器人，对应配置项 single_chat_prefix (如果不需要以前缀触发可以填写 &quot;single_chat_prefix&quot;: [&quot;&quot;])</li></ul><ul class="notion-list notion-list-disc notion-block-d814e6ce6bfc42a192a13e2856740349"><li>机器人回复的内容会以 &quot;[bot] &quot; 作为前缀， 以区分真人，对应的配置项为 single_chat_reply_prefix (如果不需要前缀可以填写 &quot;single_chat_reply_prefix&quot;: &quot;&quot;)</li></ul></div></details><details class="notion-toggle notion-block-88f265aabc6e4c8fa176f3a928b9058d"><summary>群组聊天:</summary><div><ul class="notion-list notion-list-disc notion-block-4b7e01b33e66488eaedef426bda97f81"><li>群组聊天中，群名称需配置在 group_name_white_list 中才能开启群聊自动回复。如果想对所有群聊生效，可以直接填写 &quot;group_name_white_list&quot;: [&quot;ALL_GROUP&quot;]</li></ul><ul class="notion-list notion-list-disc notion-block-932fe9c6bb1e4de8bea1ae5ef329a818"><li>默认只要被人 @ 就会触发机器人自动回复；另外群聊天中只要检测到以 &quot;@bot&quot; 开头的内容，同样会自动回复（方便自己触发），这对应配置项 group_chat_prefix</li></ul><ul class="notion-list notion-list-disc notion-block-24bb33e974ac47b5b193d9c52b0a2304"><li>可选配置: group_name_keyword_white_list配置项支持模糊匹配群名称，group_chat_keyword配置项则支持模糊匹配群消息内容，用法与上述两个配置项相同。</li></ul></div></details><details class="notion-toggle notion-block-a9d17ee7d546498192d7d8441daea41d"><summary>其他配置:</summary><div><ul class="notion-list notion-list-disc notion-block-7b3d71d308154668a6d478d9598338be"><li>proxy：由于目前 openai 接口国内无法访问，需配置代理客户端的地址</li></ul><ul class="notion-list notion-list-disc notion-block-b28afd3e0b8d442d854e974e0b53f086"><li>对于图像生成，在满足个人或群组触发条件外，还需要额外的关键词前缀来触发，对应配置 image_create_prefix</li></ul><ul class="notion-list notion-list-disc notion-block-8fb8594cee8644fab4f902495f2b8d67"><li>关于OpenAI对话及图片接口的参数配置（内容自由度、回复字数限制、图片大小等），可以参考 对话接口 和 图像接口 文档直接在 代码 bot/openai/open_ai_bot.py 中进行调整。</li></ul><ul class="notion-list notion-list-disc notion-block-7a661a6ac9ac49328173c560544a2458"><li>conversation_max_tokens：表示能够记忆的上下文最大字数（一问一答为一组对话，如果累积的对话字数超出限制，就会优先移除最早的一组对话）</li></ul><ul class="notion-list notion-list-disc notion-block-49931486ab6a4f8989cf1a74bb77d061"><li>character_desc 配置中保存着你对机器人说的一段话，他会记住这段话并作为他的设定，你可以为他定制任何人格</li></ul></div></details><div class="notion-blank notion-block-a4819db1b2e2424f9fa8421186a66478"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-b0443b263bb743af9a702c2845d9d376" data-id="b0443b263bb743af9a702c2845d9d376"><span><div id="b0443b263bb743af9a702c2845d9d376" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b0443b263bb743af9a702c2845d9d376" title="四，安装代理clash-for-linux代理（需要走代理的话）："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四，安装代理clash-for-linux代理（需要走代理的话）：</span></span></h3><div class="notion-blank notion-block-c9c3cb8f73ca42378b84a68480bed59b"> </div><div class="notion-text notion-block-a04bdc69b7134b13a5b3177b7cb5ee2d">参考链接：</div><div class="notion-blank notion-block-5db23e5bac664cf7bdf8336a971d68c2"> </div><div class="notion-blank notion-block-3f4070c8ec9b46bc8ee3fc8ddcdd39f3"> </div><div class="notion-blank notion-block-5b573ebd11b84f12942b9217e5400674"> </div><div class="notion-blank notion-block-4076c2531021488e9151e37b6ffcfc0c"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-52a824e9b0714ab8bbb3ac34d656d9e2" data-id="52a824e9b0714ab8bbb3ac34d656d9e2"><span><div id="52a824e9b0714ab8bbb3ac34d656d9e2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#52a824e9b0714ab8bbb3ac34d656d9e2" title="五，运行："><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">五，运行：</span></span></h3><ol start="1" class="notion-list notion-list-numbered notion-block-d0ae21f46aa94be2a665350624276ff0"><li>本地运行：如果是开发机 <b>本地运行</b>，直接在<b><span class="notion-inline-underscore">项目根目录</span></b>下执行：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ python3 app.py</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-394e1fbb2a72402dbcf70c6ac5a8e3c7"><li>服务器部署：使用nohup命令在后台运行程序：</li></ol><pre class="notion-code"><div class="notion-code-copy"><div class="notion-code-copy-button"><svg fill="currentColor" viewBox="0 0 16 16" width="1em" version="1.1"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg></div></div><code class="language-javascript">$ touch nohup.out                                   ## 首次运行需要新建日志文件                     
$ nohup python3 app.py &amp; tail -f nohup.out          ## 在后台运行程序并通过日志输出二维码

## 扫码登录后程序即可运行于服务器后台，此时可通过 ctrl+c 关闭日志，不会影响后台程序的运行。
## 使用 ps -ef | grep app.py | grep -v grep 命令可查看运行于后台的进程，
## 如果想要重新启动程序可以先 kill 掉对应的进程。日志关闭后如果想要再次打开只需输入 tail -f nohup.out。 
## scripts/目录有相应的脚本可以调用</code></pre><ol start="1" class="notion-list notion-list-numbered notion-block-81a55dabb2ff43bd8bfe1792bc9bb86f"><li>注意：<span class="notion-inline-underscore"><b><span class="notion-orange">务必使用实名认证的微信号，否则无法登录！登陆错误信息见下图，</span></b></span>扫码后手机提示登录验证需要等待5s，</li></ol><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1c88dfe3192940838682464c23a85de2"><div style="position:relative;display:flex;justify-content:center;align-self:start;width:624px;max-width:100%;flex-direction:column"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fc2d4e1f6-5814-4560-841c-0119595b91f6%2F111.png?table=block&amp;id=1c88dfe3-1929-4083-8682-464c23a85de2" alt="notion image" loading="lazy" decoding="async"/></div></figure><ol start="1" class="notion-list notion-list-numbered notion-block-33fc21f05e5a4c92bc8cf0574b4b0ddb"><li>多账号支持： 将项目复制多份，分别启动程序，用不同账号扫码登录即可实现同时运行。</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-ae83d010e17142edbe16c83b2a8bc005"><li>特殊指令： 用户向机器人发送 #清除记忆 即可清空该用户的上下文记忆。</li></ol><div class="notion-blank notion-block-3df2833269ba4c6abb8d1ce605e2b42d"> </div><div class="notion-text notion-block-87330052286249fc9715b86ad4a5c5a5">项目方原链接：<a target="_blank" rel="noopener noreferrer" href="https://github.com/zhayujie/chatgpt-on-wechat" class="notion-external notion-external-mention"><div class="notion-external-image"><svg viewBox="0 0 260 260"><g><path d="M128.00106,0 C57.3172926,0 0,57.3066942 0,128.00106 C0,184.555281 36.6761997,232.535542 87.534937,249.460899 C93.9320223,250.645779 96.280588,246.684165 96.280588,243.303333 C96.280588,240.251045 96.1618878,230.167899 96.106777,219.472176 C60.4967585,227.215235 52.9826207,204.369712 52.9826207,204.369712 C47.1599584,189.574598 38.770408,185.640538 38.770408,185.640538 C27.1568785,177.696113 39.6458206,177.859325 39.6458206,177.859325 C52.4993419,178.762293 59.267365,191.04987 59.267365,191.04987 C70.6837675,210.618423 89.2115753,204.961093 96.5158685,201.690482 C97.6647155,193.417512 100.981959,187.77078 104.642583,184.574357 C76.211799,181.33766 46.324819,170.362144 46.324819,121.315702 C46.324819,107.340889 51.3250588,95.9223682 59.5132437,86.9583937 C58.1842268,83.7344152 53.8029229,70.715562 60.7532354,53.0843636 C60.7532354,53.0843636 71.5019501,49.6441813 95.9626412,66.2049595 C106.172967,63.368876 117.123047,61.9465949 128.00106,61.8978432 C138.879073,61.9465949 149.837632,63.368876 160.067033,66.2049595 C184.49805,49.6441813 195.231926,53.0843636 195.231926,53.0843636 C202.199197,70.715562 197.815773,83.7344152 196.486756,86.9583937 C204.694018,95.9223682 209.660343,107.340889 209.660343,121.315702 C209.660343,170.478725 179.716133,181.303747 151.213281,184.472614 C155.80443,188.444828 159.895342,196.234518 159.895342,208.176593 C159.895342,225.303317 159.746968,239.087361 159.746968,243.303333 C159.746968,246.709601 162.05102,250.70089 168.53925,249.443941 C219.370432,232.499507 256,184.536204 256,128.00106 C256,57.3066942 198.691187,0 128.00106,0 Z M47.9405593,182.340212 C47.6586465,182.976105 46.6581745,183.166873 45.7467277,182.730227 C44.8183235,182.312656 44.2968914,181.445722 44.5978808,180.80771 C44.8734344,180.152739 45.876026,179.97045 46.8023103,180.409216 C47.7328342,180.826786 48.2627451,181.702199 47.9405593,182.340212 Z M54.2367892,187.958254 C53.6263318,188.524199 52.4329723,188.261363 51.6232682,187.366874 C50.7860088,186.474504 50.6291553,185.281144 51.2480912,184.70672 C51.8776254,184.140775 53.0349512,184.405731 53.8743302,185.298101 C54.7115892,186.201069 54.8748019,187.38595 54.2367892,187.958254 Z M58.5562413,195.146347 C57.7719732,195.691096 56.4895886,195.180261 55.6968417,194.042013 C54.9125733,192.903764 54.9125733,191.538713 55.713799,190.991845 C56.5086651,190.444977 57.7719732,190.936735 58.5753181,192.066505 C59.3574669,193.22383 59.3574669,194.58888 58.5562413,195.146347 Z M65.8613592,203.471174 C65.1597571,204.244846 63.6654083,204.03712 62.5716717,202.981538 C61.4524999,201.94927 61.1409122,200.484596 61.8446341,199.710926 C62.5547146,198.935137 64.0575422,199.15346 65.1597571,200.200564 C66.2704506,201.230712 66.6095936,202.705984 65.8613592,203.471174 Z M75.3025151,206.281542 C74.9930474,207.284134 73.553809,207.739857 72.1039724,207.313809 C70.6562556,206.875043 69.7087748,205.700761 70.0012857,204.687571 C70.302275,203.678621 71.7478721,203.20382 73.2083069,203.659543 C74.6539041,204.09619 75.6035048,205.261994 75.3025151,206.281542 Z M86.046947,207.473627 C86.0829806,208.529209 84.8535871,209.404622 83.3316829,209.4237 C81.8013,209.457614 80.563428,208.603398 80.5464708,207.564772 C80.5464708,206.498591 81.7483088,205.631657 83.2786917,205.606221 C84.8005962,205.576546 86.046947,206.424403 86.046947,207.473627 Z M96.6021471,207.069023 C96.7844366,208.099171 95.7267341,209.156872 94.215428,209.438785 C92.7295577,209.710099 91.3539086,209.074206 91.1652603,208.052538 C90.9808515,206.996955 92.0576306,205.939253 93.5413813,205.66582 C95.054807,205.402984 96.4092596,206.021919 96.6021471,207.069023 Z" fill="#161614"></path></g></svg></div><div class="notion-external-description"><div class="notion-external-title">chatgpt-on-wechat</div><div class="notion-external-subtitle"><span>zhayujie</span><span> • </span><span>Updated <!-- -->Apr 20, 2023</span></div></div></a></div><div class="notion-blank notion-block-63fea8abd23449f3a3872e7c177e198c"> </div><div class="notion-callout notion-gray_background_co notion-block-c7cacc2046fe4f708d0aafb810754e11"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text"><span class="notion-red_background">注意</span> ： 同步块的使用条件是源页面也要被<b>开放共享</b> ，否则NotionNext将无权访问，页面上会被忽略渲染。<figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cfed0d31d2504e29a1517fc08b4ef1da"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fe078a58d-d9a8-48ac-8489-34d9d71b03c8%2FUntitled.png?table=block&amp;id=cfed0d31-d250-4e29-a151-7fc08b4ef1da" alt="notion image" loading="lazy" decoding="async"/></div></figure></div></div><div class="notion-blank notion-block-9f50802004f74e10b584c8d6ee3feae7"> </div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-0152ebea3dc84b7d92c1eaba38bc244e" data-id="0152ebea3dc84b7d92c1eaba38bc244e"><span><div id="0152ebea3dc84b7d92c1eaba38bc244e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0152ebea3dc84b7d92c1eaba38bc244e" title="多级目录"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">多级目录</span></span></h2><div class="notion-text notion-block-46b66d4879f444709ce41857d04045d1">heading标题在博客中自动转为目录</div><div class="notion-row notion-block-847d868ffa6c4c549bd3bb11a757cfe8"><div class="notion-column notion-block-02ee0efedd7042b29b607355bfb42813" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><h3 class="notion-h notion-h2 notion-block-01d140533de3427d8a4d6cc7cb8af762" data-id="01d140533de3427d8a4d6cc7cb8af762"><span><div id="01d140533de3427d8a4d6cc7cb8af762" class="notion-header-anchor"></div><a class="notion-hash-link" href="#01d140533de3427d8a4d6cc7cb8af762" title="二级目录1"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二级目录1</span></span></h3><div class="notion-text notion-block-746a759e573c4e99ad520c0a7514cfd5">二级内容 1</div></div><div class="notion-spacer"></div><div class="notion-column notion-block-349b628632b74f419c9570c0c1055436" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><h3 class="notion-h notion-h2 notion-block-28eafde8fdad47a2bdd664103ca97887" data-id="28eafde8fdad47a2bdd664103ca97887"><span><div id="28eafde8fdad47a2bdd664103ca97887" class="notion-header-anchor"></div><a class="notion-hash-link" href="#28eafde8fdad47a2bdd664103ca97887" title="二级目录2"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二级目录2</span></span></h3><div class="notion-text notion-block-a9f6a32e492640d2845f7d26e4a6f20c">二级内容2</div></div><div class="notion-spacer"></div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-ddc0cc270e1f458e95003696a18e7253" data-id="ddc0cc270e1f458e95003696a18e7253"><span><div id="ddc0cc270e1f458e95003696a18e7253" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ddc0cc270e1f458e95003696a18e7253" title="二级目录3"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二级目录3</span></span></h3><div class="notion-row notion-block-4b260a3efd214d48a754b70a64644d14"><div class="notion-column notion-block-0c9f78f94a15432a8e75d53a8f6063e5" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><h4 class="notion-h notion-h3 notion-block-3bb9d7bdabb4472d8db8341bd7c79f9f" data-id="3bb9d7bdabb4472d8db8341bd7c79f9f"><span><div id="3bb9d7bdabb4472d8db8341bd7c79f9f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3bb9d7bdabb4472d8db8341bd7c79f9f" title="三级目录3.1"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三级目录3.1</span></span></h4><div class="notion-text notion-block-b6840c86ae5e43cb821ee7f702bbdcd6">不同级别的heading代表不同级别的目录</div></div><div class="notion-spacer"></div><div class="notion-column notion-block-7df8fa8e0c1348448bc083644b621524" style="width:calc((100% - (1 * min(32px, 4vw))) * 0.5)"><h4 class="notion-h notion-h3 notion-block-0dff83cde2254a088948b73c595caf3d" data-id="0dff83cde2254a088948b73c595caf3d"><span><div id="0dff83cde2254a088948b73c595caf3d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0dff83cde2254a088948b73c595caf3d" title="三级目录3.2"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三级目录3.2</span></span></h4><div class="notion-text notion-block-f71e21f33acf48d8a34acd0e1f8bf5e0">高一级目录嵌套低一级目录</div></div><div class="notion-spacer"></div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-80b20494b0974d7d8ec83ebdd700d58c" data-id="80b20494b0974d7d8ec83ebdd700d58c"><span><div id="80b20494b0974d7d8ec83ebdd700d58c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#80b20494b0974d7d8ec83ebdd700d58c" title="多级列表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">多级列表</span></span></h3><ul class="notion-list notion-list-disc notion-block-5990555c81e74395a71f5e44c896851e"><li>事物的必然性</li></ul><ol start="1" class="notion-list notion-list-numbered notion-block-0b5105d8f0a8428ab3a81a1d9f2d8188"><li>事物按规律变化，也有一种不可避免的性质．这种性质就叫做<b>必然性</b></li><ol class="notion-list notion-list-numbered notion-block-0b5105d8f0a8428ab3a81a1d9f2d8188"><li>事物的必然性，是事物本身的性质（我们反对宿命论的是其认为这一切是受神明的支配，而不是反对事物发展中存在的不可避免的性质的事实）</li><ol class="notion-list notion-list-numbered notion-block-dfa5f9b6d69d4eec83d79005f1716be3"><li>第三级别列表</li><li>第三级别列表</li></ol><li>其决定于它自己本身发展的情况和周围的条件</li><ol class="notion-list notion-list-numbered notion-block-803d76c90325475c927e3d976ac2ae38"><li>第三级别列表</li><ol class="notion-list notion-list-numbered notion-block-6be150f146914e99b46a4b2969b11d22"><li>第三级别列表</li></ol></ol></ol></ol><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-64b82ab5e1ea4f7280b4e34a5ee599d6" data-id="64b82ab5e1ea4f7280b4e34a5ee599d6"><span><div id="64b82ab5e1ea4f7280b4e34a5ee599d6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#64b82ab5e1ea4f7280b4e34a5ee599d6" title="模板使用说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">模板使用说明</span></span></h2><div class="notion-text notion-block-62b2dde9334942d8a33a85505fb8989e">若要部署你的NotionNext项目，请复制该模板，并按照模板格式创建文章：</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-a38c2a4ed4734651b9857dceed20f496" href="https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5?v=b7eb215720224ca5827bfaa5ef82cf2d"><div><div class="notion-bookmark-title">NOTION BLOG</div><div class="notion-bookmark-description">演示站点描述</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-text">https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5?v=b7eb215720224ca5827bfaa5ef82cf2d</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://tanghh.notion.site/image/https%3A%2F%2Fp1.qhimg.com%2Fbdm%2F1600_900_100%2Ft01e66d486b8e826270.jpg?table=collection&amp;id=4379bc14-5d22-453b-a153-12639616fc01&amp;spaceId=6c096b44-beb9-48ee-8f92-1efdde47f3a3&amp;width=2000&amp;userId=&amp;cache=v2" alt="NOTION BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-text notion-block-fc10c33d36f247fda9228336e793f0bf">Notion页面中，每篇文章都将有以下属性🤔：</div><table class="notion-simple-table notion-block-f3068ee3d50747b8b355f2ac9f8a7209"><tbody><tr class="notion-simple-table-row notion-block-8a587297ac2642d0800da3ab39c3a219"><td class="" style="width:148px"><div class="notion-simple-table-cell">属性</div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">必填</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">说明</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">备注</div></td></tr><tr class="notion-simple-table-row notion-block-b5d3584151d6492e898ea97ff65c2424"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">title</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell"> 是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell"> 文章标题</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">ㅤ</div></td></tr><tr class="notion-simple-table-row notion-block-b4c8fabf23bd44e89a9df95c9f026ad4"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">status</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">发布状态</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">（仅当状态为<code class="notion-inline-code">Published</code> 时会被 展示）</div></td></tr><tr class="notion-simple-table-row notion-block-b38f5dbdba2b43e798f55f50cb770755"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">type</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">是</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">页面类型 (博文<code class="notion-inline-code">Post</code> / 单页(<code class="notion-inline-code">Page</code>)</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">单页不会在博文列表显示 。</div></td></tr><tr class="notion-simple-table-row notion-block-00bed44f28d140ea8571bc77b523c681"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">summary</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">内容摘要</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">搜索和简略显示会用到</div></td></tr><tr class="notion-simple-table-row notion-block-01e4643b7dbf46d0b38c802aa72cfafd"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">date</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">发布日期</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">在V3.3.9之前的版本此项为必填。</div></td></tr><tr class="notion-simple-table-row notion-block-82c0a5301414427090af5cdd740b392a"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">category</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章分类</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可以自定义</div></td></tr><tr class="notion-simple-table-row notion-block-190e33dd84b241cab115f86a8ef52f36"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">tags</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章标签</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可多个，建议不要太多</div></td></tr><tr class="notion-simple-table-row notion-block-86adae8eca7140bc83d245e68048905a"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">slug</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">文章短路径</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell"> (每篇文章唯一，请勿 重复）</div></td></tr><tr class="notion-simple-table-row notion-block-81b3b6c9935c4f219375b6dcd7f29367"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">icon</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell">否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell">菜单栏图标(仅当<code class="notion-inline-code">Page</code>类型有效)</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell">可以参考：<a target="_blank" rel="noopener noreferrer" class="notion-link" href="https://fontawesome.com/v6/search">图标库地址</a></div></td></tr><tr class="notion-simple-table-row notion-block-2d396003f8af4a5b8e1e1a6a58cac825"><td class="" style="width:148px"><div class="notion-simple-table-cell"><code class="notion-inline-code">password</code></div></td><td class="" style="width:77.00000762939453px"><div class="notion-simple-table-cell"> 否</div></td><td class="" style="width:239.00001525878906px"><div class="notion-simple-table-cell"> 文章加锁</div></td><td class="" style="width:315.66668701171875px"><div class="notion-simple-table-cell"> 需要输入密码才允许访问</div></td></tr></tbody></table><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-f74abc78954745f8954fa80426ddd3ae" data-id="f74abc78954745f8954fa80426ddd3ae"><span><div id="f74abc78954745f8954fa80426ddd3ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f74abc78954745f8954fa80426ddd3ae" title="评论插件"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">评论插件</span></span></h2><div class="notion-text notion-block-934a86309c474a89b4f170d47af5c6c8">系统支持 Waline\Giscus\Valine\GitTalk\Utterance\Cusdis\Twikoo六种评论插件，并且可以同时开启，点击评论区的Tab来体验。</div><div class="notion-text notion-block-af7473ba4f624a8fb32c2b8d3d64dd1d">按照以下教程可以开启响应的评论插件</div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-6163415a449f46b781f6477c7408e971" href="https://tangly1024.com/article/notionnext-twikoo"><div><div class="notion-bookmark-title">NotionNext配置评论插件Twikoo | TANGLY&#x27;s BLOG</div><div class="notion-bookmark-description">一个简洁、安全、免费的静态网站评论系统，基于 腾讯云开发 。 经评论区网友推荐，我开始使用 Twikoo，一番体验，发现Twikoo真的很强大，目前我决定用它作为主要评论插件。 twikoo支持在页面上直接管理评论、配置插件，非常强大 在最新版本中 NotionNext已经 支持该评论插件，配置 方法很简单： 在Vercel后台添加一个环境变量 NEXT_PUBLIC_COMMENT_ENV_ID ; 值为您部署好的 twikoo 后台地址。以我的举例： 借助vercel，您可以非常快速地部署自己的twikoo后台，用于储存评论数据。 twikoo的后台数据存储是基于MongoDB数据库的，我们可以先注册创建一个免费的在线MongoDB数据库。 创建MongoDB数据库 1.注册账号 创建数据库 这里下方要设置一个允许访问该数据库的IP地址，推荐设置0.0.0.0，即所有地址都允许访问，毕竟我也不知道自己会用什么ip访问这个数据库。 2.获取数据库连接地址 Vercel一键部署 点击Create将twikoo的代码拷入您的仓库 配置MongoDB数据库地址 添加一个配置 MONGODB_URI 环境变量即可，其值为上一步获得的MongoDB连接地址，注意将链接中MONGODB的密码 替换成您设置的。 上述部署完成后，您将获得一个vercel的twikoo后台页面，您可以选择像我一样映射成二级域名 将您的twikoo后台地址配置在NotionNext的后台，并redeploy即可。 到此完成~ 点击右下角的小齿轮即可配置您的管理员密码、并进行更多的功能设置。赶快体验吧~ 可以访问官方文档获取安装部署帮助，并且查看Twikoo的更多特性。 NotionNext支持多种评论插件，可访问以下文章获得帮助：</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://tangly1024.com/favicon.ico" alt="NotionNext配置评论插件Twikoo | TANGLY&#x27;s BLOG" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://tangly1024.com/article/notionnext-twikoo</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://images.unsplash.com/photo-1564419320603-628d868a193f?ixlib=rb-4.0.3&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb" alt="NotionNext配置评论插件Twikoo | TANGLY&#x27;s BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-2fa7ab92145f4e72a1f3818f2ad01278" href="https://tangly1024.com/article/notion-next-comment-plugin"><div><div class="notion-bookmark-title">NotionNext如何添加评论插件 | TANGLY&#x27;s BLOG</div><div class="notion-bookmark-description">NotionNext支持多种评论插件，其中体验比较好的我个人觉得是Twikoo，您可以参考以下教程进行配置安装： 您也可以选择Valine/Waline，关于Valine/Waline的部署可以访问此篇文章： Utterance 、 Giscus 、Gitalk 其中部署最便捷的当属 Cusdis 和 Utterance 这两个插件。您可以任选一个部署，当然，您也可以选择同时部署多个。 完成效果预览 点击Start for free ，并用Github登录即可 Sign in With Github (点击查看截图) [可选] 配置邮件通知地址，以便收到新评论时邮件通知您，（点击展开截图） 点击Embed Code获取您的应用ID，即data-app-id, 复制这串id备用。 在Vercel后台添加一个环境变量 NEXT_PUBLIC_COMMENT_CUSDIS_APP_ID，值为上面获取到的data-app-id。 完成预览效果 在您的Github中创建一个开源项目用于存放评论 在github中安装utterance插件 允许utterance访问所有仓库，并勾选install，可以只勾选作为评论用的仓库地址。 将用作评论仓库名添加到Vercel添加环境变量 后台 settings→ environment variables → 添加 → save 即可。如下图： 注意， 仓库名的格式是 [您的用户名/您的仓库名] 如下示例 完成预览效果 在您的Github中创建一个开源项目用于存放评论 创建一个授权秘钥，并保存您的ClientID与ClientSecret Authorization callback URL 填写您网站域名 填写配置的效果 ，点击 register application 即可创建。 点击 Generate a new client secret 生成您的密码 复制 Client ID和刚生成的 Client secret （对应图中2和3）备用。 在Vercel后台配置环境变量 NEXT_PUBLIC_COMMENT_GITALK_CLIENT_ID NEXT_PUBLIC_COMMENT_GITALK_CLIENT_SECRET NEXT_PUBLIC_COMMENT_GITALK_CLIENT_ID NEXT_PUBLIC_COMMENT_GITALK_CLIENT_SECRET 项目会在您的Github项目讨论区创建评论数据，便于维护管理 , 完成效果 预览 您可以在Github的Discusstion讨论区随时管理评论。 在您的Github中创建一个开源项目用于存放评论 在项目Setting中开启discussion功能 在Github中安装giscus应用 点击右上方的Install即可，并确认 允许访问仓库数据权限： 默认勾选All repositories即可。也可以只勾选用作评论的仓库，（后续还可以再回来配置） 访问Giscus填写并获取您的Giscus配置参数 主要配置输入您的仓库名，并选择 Discussion分类为 Announcements .</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://tangly1024.com/favicon.ico" alt="NotionNext如何添加评论插件 | TANGLY&#x27;s BLOG" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://tangly1024.com/article/notion-next-comment-plugin</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://tangly1024.com/bg_image.jpg" alt="NotionNext如何添加评论插件 | TANGLY&#x27;s BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-row"><a target="_blank" rel="noopener noreferrer" class="notion-bookmark notion-block-61b96b3f2f0c4333a3f534d267514222" href="https://tangly1024.com/article/notionnext-valine"><div><div class="notion-bookmark-title">NotionNext配置Valine/Waline评论插件 | TANGLY&#x27;s BLOG</div><div class="notion-bookmark-description">Valine插件需要LeanCloud后端提供数据库存储功能，请按照以下步骤配置。 而Waline 的前置步骤和Valine基本一致，只是多了一个部署Waline的Vercel服务步骤。由于Waline配置了完善的后台管理功能，所以使用Waline就不需要再配合Admin-Valine项目运行。 应用创建好以后，进入刚刚创建的应用，选择左下角的 设置&gt; 应用Key，然后就能看到你的 APP ID和 APP Key 了： 为了你的数据安全，请设置自己的 安全域名 ：只有以下设置的域名，才允许访问你的valine数据 支持的Valine配置在NotionNext项目的blog.config.js 中，请在Vercel后台的环境变量中配置： serverURLs在应用内部会尝试自动获取，如果发现获取失败，请手动提供 刚刚创建的应用，选择左下角的 设置&gt; 应用Key，找到 Request 域名 第一行 需要在akismet中注册账号并获取免费的key： https://akismet.com/account ，并在LeanCloud中配置 AKISMET_KEY 变量 参考官方文档，在你的Vercel上部署一个valine应用。而后在你的NotionNext环境变量中添加你的waline服务地址环境变量： NEXT_PUBLIC_WALINE_SERVER_URL 即可生效。</div><div class="notion-bookmark-link"><div class="notion-bookmark-link-icon"><img src="https://tangly1024.com/favicon.ico" alt="NotionNext配置Valine/Waline评论插件 | TANGLY&#x27;s BLOG" loading="lazy" decoding="async"/></div><div class="notion-bookmark-link-text">https://tangly1024.com/article/notionnext-valine</div></div></div><div class="notion-bookmark-image"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F10eb466a-599b-4513-bcbf-2331cf88078d%2Fpexels-photo-546819.webp?table=block&amp;id=bee1fccf-a3bd-47a1-a7be-83cc71372d83&amp;cache=v2" alt="NotionNext配置Valine/Waline评论插件 | TANGLY&#x27;s BLOG" loading="lazy" decoding="async"/></div></a></div><div class="notion-blank notion-block-324e53b18f7c4dba8fc32796b4b2518a"> </div><div class="notion-text notion-block-60c72318cd9242419d6f6ea41d558bb5">/</div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>