use of io.discloader.discloader.entity.channel.IPrivateChannel in project DiscLoader by R3alCl0ud.
the class PrivateChannel method sendMessage.
@Override
public CompletableFuture<IMessage> sendMessage(String content, RichEmbed embed, File file) {
Attachment attachment = null;
if (file != null)
attachment = new Attachment(file.getName());
if (embed != null && embed.getThumbnail() != null && embed.getThumbnail().file != null) {
file = embed.getThumbnail().file;
embed.getThumbnail().file = null;
attachment = new Attachment(file.getName());
}
return new SendMessage<IPrivateChannel>(this, content, embed, attachment, file).execute();
}
use of io.discloader.discloader.entity.channel.IPrivateChannel in project DiscLoader by R3alCl0ud.
the class User method sendMessage.
@Override
public CompletableFuture<IMessage> sendMessage(String content, RichEmbed embed, File file) {
CompletableFuture<IMessage> future = new CompletableFuture<>();
IPrivateChannel channel = getPrivateChannel();
if (channel == null) {
try {
channel = openPrivateChannel().get();
return channel.sendMessage(content, embed, file);
} catch (ExecutionException | InterruptedException e) {
future.completeExceptionally(e.getCause());
}
return future;
}
return channel.sendMessage(content, embed, file);
}
use of io.discloader.discloader.entity.channel.IPrivateChannel in project DiscLoader by R3alCl0ud.
the class User method sendMessage.
@Override
public CompletableFuture<IMessage> sendMessage(String content, RichEmbed embed, Resource resource) {
CompletableFuture<IMessage> future = new CompletableFuture<>();
IPrivateChannel channel = getPrivateChannel();
if (channel == null) {
try {
channel = openPrivateChannel().get();
return channel.sendMessage(content, embed, resource);
} catch (ExecutionException | InterruptedException e) {
future.completeExceptionally(e.getCause());
return future;
}
}
return channel.sendMessage(content, embed, resource);
}
Aggregations