Closed KanaIshikawa closed 2 years ago
See #304
There's nothing I can do to help you at the moment.
i understand. When I stopped asynchronous processing and replaced it with synchronous processing, it worked, so this problem is okay.
Could you clarify? Are you saying when not using the async methods, the real time messaging works?
` var slackClient = new SlackSocketClient(BotToken); using (var sync = new InSync()) { slackClient.PostMessage(response => { postMessageResponse = response; sync.Proceed(); }, ChannelId, message, BotName, null, false, null, null, null, null, MessageIconEmoji); }
`
After rewriting as above, the message was able to be sent.
var fileUploadResponse = new FileUploadResponse(); var slackClient = new SlackSocketClient(BotToken); using (var sync = new InSync()) { slackClient.UploadFile( response => { fileUploadResponse = response; sync.Proceed(); }, byteData, fileName, channelIds, title); }
fileupload is similar.
It became impossible to connect to slack around 2022/9/27or28
I was able to send messages until the day before with the following source code, but I can no longer connect.
var client = new SlackSocketClient(BotToken); ManualResetEventSlim clientReady = new ManualResetEventSlim(false); client.Connect((connected) => { client.PostMessage((responce) => { }, ChannelId, options.Text, BotName, null, false, null, null, null, null, MessageIconEmoji); clientReady.Set(); }); if(clientReady.Wait(60 * 1000) == false) { Console.Error.WriteLine("// ERROR : Send Slack is fault."); }
However, since the message can be sent using curl, the token by bots should not be wrong.curl -d "token=(tokenID)" -d "text=hoge." -d "channel=(channelID)" -X POST https://(myWorkspace)/api/chat.postMessage
please help me please.