示例#1
0
        public async Task SendPhotoToGroupAsync(FileToChannelOrGroupDto model)
        {
            var groupId = await GetGroupIdAsync(model.Title);

            await SendFile(groupId, model.Path, MessageBuilder(model.SenderName, model.Subject, model.Caption), model.MimeType, model.Name);

            Thread.Sleep(DileyTime);
        }
示例#2
0
        public async Task SendPhotoToGroupAsync(FileToChannelOrGroupDto model)
        {
            var group = await GetGroupAsync(model.Title);

            var fileResult = await UpLoadFileAsync(model.Path, model.Name);

            await client.SendUploadedPhoto(new TLInputPeerChannel()
            {
                ChannelId = group.Id, AccessHash = group.AccessHash.Value
            },
                                           fileResult, MessageBuilder(model.SenderName, model.Subject, model.Caption));

            Thread.Sleep(DileyTime);
        }
示例#3
0
        public async Task SendFileToGroupAsync(FileToChannelOrGroupDto model)
        {
            var group = await GetGroupAsync(model.Title);

            var fileResult = await UpLoadFileAsync(model.Path, model.Name);

            await client.SendUploadedDocument(
                new TLInputPeerChannel()
            {
                ChannelId = group.Id, AccessHash = group.AccessHash.Value
            },
                fileResult,
                MessageBuilder(model.SenderName, model.Subject, model.Caption),
                model.MimeType,
                new TLVector <TLAbsDocumentAttribute>()
            {
                new TLDocumentAttributeFilename
                {
                    FileName = model.Name
                }
            });

            Thread.Sleep(DileyTime);
        }
示例#4
0
 public async Task SendPhotoToChannelAsync(FileToChannelOrGroupDto model)
 => throw new NotImplementedException("This method is not supported in Slack");
示例#5
0
 public async Task SendFileToGroupAsync(FileToChannelOrGroupDto model)
 => throw new NotImplementedException("This method is not supported in email");