Ejemplo n.º 1
0
        public async Task EditAsync(MessageEditProperties properties)
        {
            if (Type != MessageType.Default)
            {
                throw new InvalidOperationException("Can only edit messages of type Default");
            }

            Update(await Client.EditMessageAsync(Channel.Id, Id, properties));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Edits the message
 /// </summary>
 /// <param name="message">The new contents of the message</param>
 public void Edit(MessageEditProperties properties)
 {
     EditAsync(properties).GetAwaiter().GetResult();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Edits a message
 /// </summary>
 /// <param name="channelId">ID of the channel</param>
 /// <param name="messageId">ID of the channel</param>
 /// <param name="message">New content of the message</param>
 /// <returns>The edited message</returns>
 public static DiscordMessage EditMessage(this DiscordClient client, ulong channelId, ulong messageId, MessageEditProperties properties)
 {
     return(client.EditMessageAsync(channelId, messageId, properties).GetAwaiter().GetResult());
 }
Ejemplo n.º 4
0
 public static async Task <DiscordMessage> EditMessageAsync(this DiscordClient client, ulong channelId, ulong messageId, MessageEditProperties properties)
 {
     return((await client.HttpClient.PatchAsync($"/channels/{channelId}/messages/{messageId}", properties))
            .Deserialize <DiscordMessage>().SetClient(client));
 }