我想要做的是,当机器人启动时,抓取好友列表,并对其中的每个人进行DM。我不能使用ctx,因为on_ready不支持它。到目前为止我的代码如下:
@bot.event
async def on_ready(msg):
for x in bot.user.friends:
e = x.id
await x.send('hi')
我开始使用discord.py,我不明白为什么我的bot不响应我的test命令,.the bot正在正确地启动,并且在启动时说他在通道中的线路,但不响应我的命令
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='$')
class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as {0}!'.format(self.user
每次在WSL2上启动Ubuntu时,我都需要运行WSL2。
当我启动Ubuntu时,如何使服务自动启动?
WSL不使用systemd,所以sudo systemctl enable postgresql不能工作。
$ sudo systemctl status postgresql
System has not been booted with systemd as init system (PID 1).
Can't operate. Failed to connect to bus: Host is down
是否有一种在启动时启动服务的标准方法?
编辑
我想在Ubuntu启动时