在上述代码中,首先使用 discord.utils.get 函数来获取服务器和语音通道对象,然后通过访问对象的 .id 属性获取语音通道的ID。如果找不到该语音通道,则会输出一条相应的提示信息。 请注意,上述代码中的 "server_name" 和 "voice_channel" 需要替换为实际的服务器名称和语音通道名称。此外,还可以根据实际需求进行...
get_channel(id=get_channel_id) await channel.send(embed=embed) @client.command() async def welcomechannel(ctx, channel_id): with open('./json/welcome.json', 'r') as f: id = json.load(f) id[str(ctx.guild.id)] = channel_id with open('./json/welcome.json', 'w') as f: json...
首先,获取频道ID(右键单击频道并选择“复制ID”) 其次,将ID放在以下代码中: client.get_channel("ID") 例如: client.get_channel("182583972662") 注意: 频道ID在discord.py async中是一个字符串,在rewrite中是一个整数 (感谢 Ari24 指出这一点) 从名称获取频道(不推荐) 首先,使用以下任一方式获取服务器...
name='用户测试服务器')ifguild:channel=discordPy.utils.get(guild.channels,name='常规')ifchannel:awaitchannel.send(f'欢迎 {member.name} 加入服务器!')# 给新进用户贴上新人标签newbee_role=discordPy.utils.get(guild.roles,name='新人组')awaitmember.add_roles(newbee_role...
value="For help with the bot or a laugh join **https://discord.gg/n4b94VA**!")awaitutil.say(ctx.channel, embed=info_embed) 开发者ID:MacDue,项目名称:DueUtil,代码行数:20,代码来源:util.py 示例5: about ▲点赞 6▼ # 需要导入模块: import discord [as 别名]# 或者: from discord impo...
Operation ID: GetCurrentUserGuilds Returns a list of partial guild objects the current user is a member of. Returns response array of Guild Get User Connections Operation ID: GetUserConnections Returns a list of connection objects. Returns response array of Connection Definitions Channel Connect...
开发者ID:mdiller,项目名称:MangoByte,代码行数:23,代码来源:audio.py 示例2: on_guild_channel_delete ▲点赞 7▼ # 需要导入模块: import discord [as 别名]# 或者: from discord importVoiceChannel[as 别名]defon_guild_channel_delete(self, channel: GUILD_CHANNEL)->None:"""Log channel delete event...
A simple to setup process for end-users. Server members may view or send messages into an embedded Discord channel. flask widget discord chatbot discord-bot embed webapp discordpy discord-py titan discord-py-bot Updated Mar 31, 2023 Python ...
If you want moderation messages, create and copy the channel id for each server that you want the moderation messages to send to inSERVER_TO_MODERATION_CHANNEL. This should be of the format:server_id:channel_id,server_id_2:channel_id_2 ...
只需删除reason参数你踢的原因被抓住了arg@bot.command(pass_context=True)async def kick(ctx, user:...