赛程通知
This commit is contained in:
		
							parent
							
								
									1da5474826
								
							
						
					
					
						commit
						4a94003297
					
				@ -8,6 +8,10 @@ using NPOI.OpenXmlFormats.Spreadsheet;
 | 
				
			|||||||
using Castle.Components.DictionaryAdapter;
 | 
					using Castle.Components.DictionaryAdapter;
 | 
				
			||||||
using Flandre.Core.Messaging;
 | 
					using Flandre.Core.Messaging;
 | 
				
			||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
 | 
					using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
 | 
				
			||||||
 | 
					using Flandre.Core.Common;
 | 
				
			||||||
 | 
					using Flandre.Core.Messaging.Segments;
 | 
				
			||||||
 | 
					using static asg_form.Controllers.InviteReferee;
 | 
				
			||||||
 | 
					using Mirai.Net.Data.Shared;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace asg_form.Controllers
 | 
					namespace asg_form.Controllers
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -170,6 +174,21 @@ namespace asg_form.Controllers
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                await testDb.SaveChangesAsync();
 | 
					                await testDb.SaveChangesAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                try
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    
 | 
				
			||||||
 | 
					                    var message1 = new MessageBuilder().Image(GetPictureData($@"{AppDomain.CurrentDomain.BaseDirectory}loge\{game.belong}\{winteam}.png")).Text($"恭喜战队{winteam}获胜!").Build();
 | 
				
			||||||
 | 
					                    await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "456414070", null, message1, "456414070");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                catch 
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    var message1 = new MessageBuilder().Text($"恭喜战队{winteam}获胜!").Build();
 | 
				
			||||||
 | 
					                    await runbot.runbotr.SendMessageAsync(MessageEnvironment.Channel, "456414070", null, message1, "456414070");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                return "ok";
 | 
					                return "ok";
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
@ -179,7 +198,14 @@ namespace asg_form.Controllers
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        public byte[] GetPictureData(string imagePath)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            FileStream fs = new FileStream(imagePath, FileMode.Open);
 | 
				
			||||||
 | 
					            byte[] byteData = new byte[fs.Length];
 | 
				
			||||||
 | 
					            fs.Read(byteData, 0, byteData.Length);
 | 
				
			||||||
 | 
					            fs.Close();
 | 
				
			||||||
 | 
					            return byteData;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 删除竞猜比赛
 | 
					        /// 删除竞猜比赛
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user