【发布时间】:2018-03-30 23:25:24
【问题描述】:
Conosle.WriteLine("它成功了!") 它正在所有 Twitch.tv/channels 上执行
但是……
PRIVMSG #Twitch.tv/channel 仅适用于我自己的频道,即 twitch.tv/traps_are_not_gay_baka
我的意思是我可以从我放入频道字符串的任何频道中读取消息,但 PRIVMSG 仅适用于我自己的频道,当我将其切换到 Twitch.tv/bakoni 之类的东西时,这是我发现并用于测试 PRIVMSG 的随机频道只是不要到达。
为什么会这样?
编辑:(代码)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text;
using System.Net.Sockets;
using System.IO;
namespace chatrig
{
class chatrig
{
static String ip = "irc.twitch.tv";
static Int32 port = 6667;
static String username = "traps_are_not_gay_baka";
static String password = "oauth:hokzuz***********ebkv5gnb";
static String clientID = "2lubvv5***********3f2m8orz24c";
static String channel = "bakoni";
static TcpClient tcpClient = new TcpClient(ip, port);
static StreamReader reader = new StreamReader(tcpClient.GetStream());
static StreamWriter writer = new StreamWriter(tcpClient.GetStream());
static void Main(string[] args)
{
writer.WriteLine("PASS " + password);
writer.Flush();
writer.WriteLine("NICK " + username);
writer.Flush();
writer.WriteLine("USER " + username + " 8 * :" + username);
writer.Flush();
writer.WriteLine("JOIN #" + channel);
writer.Flush();
while (true)
{
var message = reader.ReadLine();
Console.WriteLine(message);
if (message.Contains("yandYo"))
{
writer.WriteLine("PRIVMSG #" + channel + " :" + "w" + "\r\n");
writer.Flush();
Console.WriteLine("It worked!");
}
}
}
}
}
【问题讨论】:
-
请在问题中包含您的代码 - 图片无法使用。见stackoverflow.com/help/how-to-ask
-
我刚刚收录了
标签: c# bots streamwriter irc twitch