Пример #1
0
 public Message SendMessage(MessageProperties properties)
 {
     return(Client.SendMessage(Id, properties));
 }
Пример #2
0
 public DiscordMessage SendMessage(MessageProperties properties)
 {
     return(SendMessageAsync(properties).GetAwaiter().GetResult());
 }
Пример #3
0
 public Task <DiscordMessage> SendMessageAsync(MessageProperties properties)
 {
     return(Client.SendMessageAsync(Id, properties));
 }
Пример #4
0
 public static DiscordMessage SendMessage(this DiscordClient client, ulong channelId, MessageProperties properties)
 {
     return(client.SendMessageAsync(channelId, properties).GetAwaiter().GetResult());
 }
Пример #5
0
        public static async Task <DiscordMessage> SendMessageAsync(this DiscordClient client, ulong channelId, MessageProperties properties)
        {
            if (properties.ReplyTo != null)
            {
                properties.ReplyTo.ChannelId = channelId;
            }

            return((await client.HttpClient.PostAsync($"/channels/{channelId}/messages", properties))
                   .Deserialize <DiscordMessage>().SetClient(client));
        }
Пример #6
0
 public static Message SendMessage(this DiscordClient client, long channelId, MessageProperties properties)
 {
     return(client.HttpClient.Post($"/channels/{channelId}/messages",
                                   JsonConvert.SerializeObject(properties)).Deserialize <Message>().SetClient(client));
 }