Ejemplo n.º 1
0
        public RuntimeMessage(IMessage msg)
        {
            messageData = msg;

            if (msg.Author != null)
            {
                user = new RuntimeUser(msg.Author);
            }
            if (msg.Channel != null)
            {
                channel = new RuntimeMessageChannel(msg.Channel);
            }
            IGuild g = (messageData.Author as IGuildUser)?.Guild;

            if (g != null)
            {
                guild = new RuntimeGuild(g);
            }
        }
Ejemplo n.º 2
0
        public RuntimeMessage(IMessage msg, DiscordSocketClient c)
        {
            messageData = msg;

            if (msg.Author != null)
            {
                user = new RuntimeUser(msg.Author);
            }
            if (msg.Channel != null)
            {
                channel = new RuntimeMessageChannel(msg.Channel);
            }
            IGuild g = (messageData.Author as IGuildUser)?.Guild;

            if (g != null)
            {
                guild = new RuntimeGuild(g);
            }
            client = new RuntimeClient(c);
        }
Ejemplo n.º 3
0
 public static async Task <RuntimeAudioClient> Create(RuntimeUser u)
 {
     return(new RuntimeAudioClient(await(u.ToNativeObject() as IGuildUser).VoiceChannel?.ConnectAsync()));
 }