本文整理汇总了Java中com.jagrosh.jdautilities.commandclient.CommandEvent.reactSuccess方法的典型用法代码示例。如果您正苦于以下问题:Java CommandEvent.reactSuccess方法的具体用法?Java CommandEvent.reactSuccess怎么用?Java CommandEvent.reactSuccess使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jagrosh.jdautilities.commandclient.CommandEvent
的用法示例。
在下文中一共展示了CommandEvent.reactSuccess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void execute(CommandEvent event) {
if (event.isFromType(ChannelType.TEXT)) {
String id = Constant.getTextChannelConf().getProperty(event.getGuild().getId());
if (id != null) {
if (!event.getChannel().getId().equals(id)) {
return;
}
}
}
if (event.getGuild().getAudioManager().isConnected()) {
if (!Constant.music.getGuildAudioPlayer(event.getGuild()).scheduler.getQueue().isEmpty()) {
Constant.music.getGuildAudioPlayer(event.getGuild()).scheduler.shuffleQueue();
event.reactSuccess();
}else{
event.reply("The queue is empty, there is nothing to shuffle");
}
}else{
event.replyWarning(event.getMember().getAsMention() + " I'm not even connected :joy:");
}
}
示例2: execute
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void execute(CommandEvent event) {
Properties p = Constant.getTextChannelConf();
if (p.getProperty(event.getGuild().getId()) == null) {
p.put(event.getGuild().getId(), "");
}
if (event.getArgs().isEmpty()) {
p.replace(event.getGuild().getId(), event.getChannel().getId());
} else {
try {
Constant.getVoiceChannelConf().getProperty(event.getGuild().getId());
p.remove(event.getGuild().getId());
} catch (Exception e) {
event.replyError("Please unset the voice channel first.\nSee `"+Constant.prefix+"help setVoiceChannel`");
}
}
Constant.writeTextChannelConf(p);
event.reactSuccess();
}
示例3: execute
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void execute(CommandEvent event) {
try {
Constant.getTextChannelConf().get(event.getGuild().getId());
Properties p = Constant.getVoiceChannelConf();
if (p.getProperty(event.getGuild().getId()) == null) {
p.put(event.getGuild().getId(), "");
}
if (!event.getArgs().isEmpty()) {
p.replace(event.getGuild().getId(), event.getArgs());
} else {
p.remove(event.getGuild().getId());
}
Constant.writeVoiceChannelConf(p);
event.reactSuccess();
} catch (Exception e) {
event.replyError("Please set a text channel first.\nSee `"+Constant.prefix+"help setTextChannel`");
}
}
示例4: replyAndKeep
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
public void replyAndKeep(Config config, CommandEvent commandEvent, String message) {
if (config != null && config.getReplyInDmWhenPossible()) {
commandEvent.replyInDM(message);
commandEvent.reactSuccess();
handleOriginMessage(commandEvent);
} else {
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setAuthor(null, null, null);
embedBuilder.setTitle(null);
embedBuilder.setDescription(message);
final MessageEmbed messageEmbed = embedBuilder.build();
replyThenDeleteFeedbackAndOriginMessageAfterXTime(commandEvent,
messageEmbed, BotServerMain.timeToRemoveFeedbackInSeconds * 3, TimeUnit.SECONDS);
}
}
示例5: reply
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
public void reply(Config config, CommandEvent commandEvent, String message, int numberOfSecondsBeforeRemove,
LocaleService localeService) {
Validate.isTrue(numberOfSecondsBeforeRemove > 5);
if (config != null && config.getReplyInDmWhenPossible()) {
commandEvent.replyInDM(message);
commandEvent.reactSuccess();
} else {
commandEvent.reactSuccess();
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setAuthor(null, null, null);
embedBuilder.setTitle(null);
embedBuilder.setDescription(message);
commandEvent.reply(embedBuilder.build());
}
}
示例6: reply
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
public void reply(Config config, CommandEvent commandEvent, String message) {
if (config != null && config.getReplyInDmWhenPossible()) {
commandEvent.replyInDM(message);
commandEvent.reactSuccess();
handleOriginMessage(commandEvent);
} else {
EmbedBuilder embedBuilder = new EmbedBuilder();
embedBuilder.setAuthor(null, null, null);
embedBuilder.setTitle(null);
embedBuilder.setDescription(message);
final MessageEmbed messageEmbed = embedBuilder.build();
replyThenDeleteFeedbackAndOriginMessageAfterXTime(commandEvent, messageEmbed,
BotServerMain.timeToRemoveFeedbackInSeconds, TimeUnit.SECONDS);
}
}
示例7: replyMap
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
public void replyMap(Config config, CommandEvent commandEvent, MessageEmbed message) {
if (config != null && config.getReplyInDmWhenPossible()) {
commandEvent.replyInDM(message);
commandEvent.reactSuccess();
handleOriginMessage(commandEvent);
} else {
commandEvent.getChannel().sendMessage(message).queue(m -> {
m.delete().queueAfter(BotServerMain.timeToRemoveFeedbackInSeconds * 4, TimeUnit.SECONDS);
});
commandEvent.getChannel().deleteMessageById(commandEvent.getMessage().getId()).queueAfter(
BotServerMain.timeToRemoveFeedbackInSeconds, TimeUnit.SECONDS
);
}
}
示例8: execute
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void execute(CommandEvent event)
{
try
{
System.gc();
event.reactSuccess();
}
catch(Exception e)
{
event.replyError("Error when optimizing the bot! Check the Bot console for more information.");
e.printStackTrace();
}
}
示例9: execute
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void execute(CommandEvent event)
{
event.reactSuccess();
db.shutdown();
event.getJDA().shutdown();
}
示例10: execute
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void execute(CommandEvent event) {
if (event.isFromType(ChannelType.TEXT)) {
String id = Constant.getTextChannelConf().getProperty(event.getGuild().getId());
if (id != null) {
if (!event.getChannel().getId().equals(id)) {
return;
}
}
}
if (event.getGuild().getAudioManager().isConnected()) {
if (!event.getArgs().isEmpty()) {
try {
boolean ok = Constant.music.getGuildAudioPlayer(event.getGuild()).scheduler.changeVolume(Integer.parseInt(event.getArgs()));
if (!ok) {
event.replyWarning(event.getMember().getAsMention() + " Usage : `volume 1 - 150`");
}else{
event.reactSuccess();
}
} catch (Exception e) {
event.replyWarning(event.getMember().getAsMention() + " Usage : `volume 1 - 150`");
}
} else {
event.reply("Volume: "+Constant.music.getGuildAudioPlayer(event.getGuild()).scheduler.getVolume());
}
} else {
event.replyWarning(event.getMember().getAsMention() + " I'm not even connected :joy:");
}
}
示例11: reply
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
public void reply(Config config, CommandEvent commandEvent, MessageEmbed message) {
if (config != null && config.getReplyInDmWhenPossible()) {
commandEvent.replyInDM(message);
commandEvent.reactSuccess();
} else {
commandEvent.reply(message);
}
}
示例12: changePokemon
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
public static void changePokemon(Command command, GymRepository gymRepository, LocaleService localeService,
PokemonRepository pokemonRepository, RaidRepository raidRepository,
CommandEvent commandEvent,
Config config, User user, String userName,
String newPokemonName, String... gymArguments) {
String whatToChangeTo;
StringBuilder gymNameBuilder;
String gymName;
Gym gym;
Raid raid;
whatToChangeTo = newPokemonName;
gymNameBuilder = new StringBuilder();
for (String arg : gymArguments) {
gymNameBuilder.append(arg).append(" ");
}
gymName = gymNameBuilder.toString().trim();
gym = gymRepository.search(user, gymName, config.getRegion());
Raid pokemonRaid = raidRepository.getActiveRaidOrFallbackToExRaid(gym, config.getRegion(), user);
final Pokemon pokemon = pokemonRepository.search(whatToChangeTo, user);
if (pokemonRaid.isExRaid()) {
throw new UserMessedUpException(userName, localeService.getMessageFor(
LocaleService.EX_NO_CHANGE_POKEMON,
localeService.getLocaleForUser(user)));
}
// Anybody should be able to report hatched eggs
if (!pokemonRaid.getPokemon().isEgg()) {
verifyPermission(localeService, commandEvent, user, pokemonRaid, config);
}
if (Utils.isRaidExPokemon(whatToChangeTo)) {
throw new UserMessedUpException(userName, localeService.getMessageFor(
LocaleService.EX_CANT_CHANGE_RAID_TYPE, localeService.getLocaleForUser(user)));
}
raid = raidRepository.changePokemon(pokemonRaid, pokemon, commandEvent.getGuild(), config, user,
"!raid change pokemon " + pokemon.getName() + " " + gymName);
commandEvent.reactSuccess();
removeOriginMessageIfConfigSaysSo(config, commandEvent);
LOGGER.info("Changed pokemon for raid: " + raid);
}
示例13: executeWithConfig
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void executeWithConfig(CommandEvent commandEvent, Config config) {
String args = commandEvent.getArgs();
final String userId = commandEvent.getAuthor().getId();
final User user = commandEvent.getAuthor();
if (args == null || args.length() < 1) {
trackingService.removeAllForUser(user);
commandEvent.reactSuccess();
} else {
Pokemon pokemon = pokemonRepository.search(args, user);
trackingService.removeForUser(new PokemonTrackingTarget(userId, pokemon), user);
commandEvent.reactSuccess();
}
removeOriginMessageIfConfigSaysSo(config, commandEvent);
}
示例14: executeWithConfig
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void executeWithConfig(CommandEvent commandEvent, Config config) {
final User user = commandEvent.getAuthor();
final String[] args = commandEvent.getArgs().split(" ");
final Locale locale = localeService.getLocaleForUser(user);
if (args.length < 2) {
throw new UserMessedUpException(user, localeService.getMessageFor(LocaleService.BAD_SYNTAX,
localeService.getLocaleForUser(user), "!raid group 10:00 solna platform"));
}
String timeString = args[0];
LocalTime startAtTime = Utils.parseTime(user, timeString, localeService);
assertTimeNotInNoRaidTimespan(user, startAtTime, localeService);
StringBuilder gymNameBuilder = new StringBuilder();
for (int i = 1; i < args.length; i++) {
gymNameBuilder.append(args[i]).append(" ");
}
String gymName = gymNameBuilder.toString().trim();
final Gym gym = gymRepository.search(user, gymName, config.getRegion());
final Raid raid = raidRepository.getActiveRaidOrFallbackToExRaid(gym, config.getRegion(), user);
createRaidGroup(commandEvent.getChannel(), commandEvent.getGuild(),
config, user, locale, startAtTime, raid.getId(),
localeService, raidRepository, botService, serverConfigRepository, pokemonRepository, gymRepository,
clockService, executorService, pokemonRaidStrategyService);
commandEvent.reactSuccess();
removeOriginMessageIfConfigSaysSo(config, commandEvent);
}
示例15: execute
import com.jagrosh.jdautilities.commandclient.CommandEvent; //导入方法依赖的package包/类
@Override
protected void execute(CommandEvent event) {
event.reactSuccess();
bot.shutdown();
}