我有这个 github 仓库:https ://github.com/salmanfazal01/next-firebase-starter
基本上我正在使用 NextJS、Firebase 和 Zustand 创建一个基本样板作为全局状态管理器
我无法在 Zustand 中保留主题、用户等一些状态。刷新窗口后,它默认返回默认主题。
我确实尝试了 zustand 提供的持久中间件,尽管它有效,但它会导致服务器和客户端的内容不匹配错误
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Run Code Online (Sandbox Code Playgroud)
我将如何在不使用其他库(如下一个主题)的情况下将主题模式保留在状态中?
我不熟悉 Discord 机器人或 Python 的大部分内容,所以这是一个我无法找出答案的简单问题。
我有两个文件;Discord_bot.py 和 test.py 如何转发来自 test.py 的消息以将其发送到 Discord 中的频道?
测试.py
import discord_bot
discord_bot.signal(msg = "Hi")
Run Code Online (Sandbox Code Playgroud)
discord_bot.py
import discord
from discord.ext import commands
TOKEN = '1234567890'
bot = commands.Bot(command_prefix='!')
@bot.command()
async def signal(ctx, *, msg):
await ctx.send(msg)
Run Code Online (Sandbox Code Playgroud)
Discord 机器人工作正常,但从测试中调用信号函数并不是正确的方法。请问这里有什么帮助吗?