我试图使t!suggestion命令在不同的服务器上工作。我的问题是,我在下面的代码中使用了通道ID,它显然不在第二个服务器上工作。因此,我的想法是交换频道ID并使用频道名称。不幸的是我不知道该怎么做。因此,我的问题是。是否可以只更改代码并使用通道名称而不是通道ID,这是否有效?
bot.on("message", async (message) => {
if (message.content.startsWith("t!suggestion")) {
var str = message.content.slice(" t
我正在尝试使用YouTube data API V3从我的通道检索数据。
为此,我需要我的频道ID。
我试图从我的YouTube帐户中找到我的频道ID,但我在所有方面都失败了。
如果有人能给我一个建议,我会非常高兴的。
这是我用来检索数据的:
id=fjTOrCPnAblTngWAzpnlMA&key={YOUR_API_KEY}&part=snippet,contentDetails,统计信息
API 用于通道ID,密钥,我将用在Google API控制台生成的密钥替换{YOUR_API_KEY}。
我的频道ID不是:
klauskkpmklausmachadoklaus
广播工作,但它使用notifiable_type作为频道名与用户id。但是,如果我只想在后端api上更改一些模型在10个子文件夹中,那该怎么办呢?我需要在任何地方改变这个频道.
我从医生那里找到了这个:
/**
* The channels the user receives notification broadcasts on.
*
* @return string
*/
public function receivesBroadcastNotificationsOn()
{
return 'users.'.$this->id;
}
但是它不起作用,它仍
当我断开我的机器人与频道的连接时,它会停止其他频道中的所有音乐。我目前正在使用create_ytdl_player()函数来流式播放音乐。有什么帮助吗?
当前代码:
elif message.startswith('~disconnect'):
for x in client.voice_clients:
if x.server == msg.server:
print("Found Server!")
await x.disconnect()
VoiceOn[msg.channel.server.id]
由于某些原因,我无法通过API获取某些频道的任何信息。例如,此通道:和API请求
GET https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=vithorvascovv&key={YOUR_API_KEY}
给了我一个空洞的回答。为什么?您可以使用part=id和forUsername=vithorvascovv进行。
即使我使用这样的搜索方法:
GET https://www.googleapis.com/youtube/v3/search?part=id&q=vithorvascovv
我是非常新的松弛api集成使用节点js。我正在努力了解频道的历史。甚至我也试过用chat.postMessage。但每次都会让我犯以下错误:
{ Error: An API error occurred: channel_not_found
at platformErrorFromResult (..\node_modules\@slack\client\dist\WebClient.js:747:42)
at __await.makeRequest.then (..\node_modules\@slack\client\dist\WebClient.js:464:39)
at
已经被一个问题困扰了一段时间,所以希望在这里得到一些帮助。
我制作了一个电视指南,包括5个不同的视图,ChannelOne,ChannelTwo,ChannelThree,ChannelFour和一个显示所有四个频道(FullView)的视图。我对此有5个表,并按实体框架制作了5个相应的模型,具有此属性(其他4个模型类似):
public partial class ChannelOne
{
public int Id_ChannelOne_ { get; set; }
public string Channel_ChannelOne_ { get; set; }
pu
当一个特定的用户被移动到语音频道时,我正在尝试播放一个mp3文件。
在discord.py中重写:
async def on_voice_state_update(member, before, after):
user = bot.get_user("my user id")
if after.afk and user == True:
channel = bot.get_channel("the id of the channel I want the bot to connect to")
voice = await channel.con
类似于,但是我希望能够将它发送到它可以访问的每个频道!在我通过ID和发出的命令验证自己之后,在on message事件中,我使用了以下代码:
const listedChannels = [];
msg.guild.channels.forEach(channel => {
//get all channels
client.channels.get(channel.id).send("you like bred? (message) ");
//send a message to every channel i
来自的说明fetch_channel是一个API调用,它应该返回与get_channel相同的东西(返回通道)。
我尝试使用client.get_channel来获取我的dm频道,但它返回None。但在我将其更改为client.fetch_channel后,它工作得很好。
我在discord.ext.tasks.loop函数中调用了它们(该函数将每隔n秒调用一次),如下所示:
# this alarmSender() will be called every 10 seconds
@tasks.loop(seconds=10)
async def alarmSender():
chnl