示例#1
0
        public static async Task Client_UnknownEvent(DiscordClient sender, UnknownEventArgs e)
        {
            var msg = "Unknown Event Triggered: " + e.EventName;

            sender.Logger.LogWarning(msg);
            await LogChannel.SendLogMessageAsync("Unknow Event", msg, LogLevel.Warning);
        }
示例#2
0
 private async Task OnUnknownEvent(UnknownEventArgs e)
 {
     if (UnknownEvent != null)
     {
         await UnknownEvent(e);
     }
 }
示例#3
0
        public void MethodUnknownGenericClass()
        {
            //IL_00b1: Unknown result type (might be due to invalid IL or missing references)
            //IL_00bc: Expected O, but got Unknown
            //IL_00be: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
            //IL_00cd: Expected O, but got Unknown
            //IL_00cd: Expected O, but got Unknown
            //IL_00d0: Unknown result type (might be due to invalid IL or missing references)
            //IL_00d5: Unknown result type (might be due to invalid IL or missing references)
            //IL_00e1: Expected O, but got Unknown
            //IL_00e1: Expected O, but got Unknown
            UnknownGenericClass <UnknownEventArgs> val = new UnknownGenericClass <UnknownEventArgs>();
            UnknownEventArgs unknownProperty           = val.UnknownProperty;

            val.UnknownProperty = unknownProperty;
            List <object> list = new List <object> {
                val[((object)unknownProperty).GetHashCode()] ?? "",
                val.NotProperty,
                val.get_NotPropertyWithGeneric <string>(42),
                val[42],
                val.get_NotPropertyWithParameterAndGeneric <object>(int.MinValue),
                val.get_PropertyCalledGet
            };

            val.OnEvent += Instance_OnEvent;
            val.OnEvent -= Instance_OnEvent;
            UnknownEventArgs val2 = val[(UnknownEventArgs)null];

            val[new UnknownEventArgs()] = val2;
            UnknownEventArgs val3 = val[new UnknownEventArgs(), new UnknownEventArgs()];

            val[new UnknownEventArgs(), new UnknownEventArgs()] = val3;
        }
示例#4
0
        private async Task OnUnknownEvent(UnknownEventArgs e)
        {
            var file    = $"{Guid.NewGuid()}_{e.EventName}.json";
            var message = $"An unknown event happened: {e.EventName}{Environment.NewLine}" +
                          $"It was saved with the name {file}";
            await Services.GetRequiredService <Logger>()
            .LogAsync(new LogMessage(LogLevel.Critical, $"Winson {e.Client.ShardId}", message));

            File.AppendAllText(file, e.Json);
        }
示例#5
0
 private void Instance_OnEvent(object sender, UnknownEventArgs e)
 {
     throw new NotImplementedException();
 }
示例#6
0
 private Task UnknownEvent(UnknownEventArgs e)
 {
     /* This would kill my bot */
     return(Task.CompletedTask);
 }
示例#7
0
 private Task Client_UnknownEvent(UnknownEventArgs e)
 {
     e.Client.DebugLogger.LogMessage(LogLevel.Info, "BotApp", e.ToString(), DateTime.Now);
     return(Task.CompletedTask);
 }
 public static Task UnknownEventHandlerAsync(TheGodfatherBot shard, UnknownEventArgs e)
 {
     Log.Error("Unknown event ({UnknownEvent}) occured: {@UnknownEventJson}", e.EventName, e.Json);
     return(Task.CompletedTask);
 }
示例#9
0
 public static async Task UnknownEvent(DiscordClient c, UnknownEventArgs a)
 {
     await logger.InfoAsync("Unknown Event: " + a.EventName).ConfigureAwait(false);
 }
示例#10
0
 private Task Event_UnknownEvent(DiscordClient d, UnknownEventArgs e)
 {
     d.Logger.LogDebug(BotEventId, "Event_UnknownEvent.");
     return(Task.CompletedTask);
 }