Discord Binding

This commit is contained in:
Debucquoy Anthony 2024-01-26 23:47:46 +01:00
parent 402b94a797
commit 2b2683b22b
Signed by: tonitch
GPG Key ID: A78D6421F083D42E
3 changed files with 8 additions and 16 deletions

View File

@ -4,9 +4,9 @@
- [-] Make Discord Webhoook for item changes
- [x] deathBan reset
- [x] voids exchanges
- [x] /void give négatives values
- [ ] chest name
- [ ] /void manage bring
- [ ] Dupe bug (respawn) -> Gamerule
- [x] /void give négatives values
- [ ] /void give afficher title
- subtitle + chat

View File

@ -15,7 +15,6 @@ import org.bukkit.entity.Player;
import net.kyori.adventure.text.Component;
import ovh.herisson.thevoidroad.DatabaseManager;
import ovh.herisson.thevoidroad.DiscordWebhook;
import ovh.herisson.thevoidroad.TheVoidRoad;
import ovh.herisson.thevoidroad.Voids;
import ovh.herisson.thevoidroad.Entity.Merchand;
@ -69,19 +68,6 @@ public class VoidCommands implements CommandExecutor, TabCompleter{
return true;
case "skip":
//TODO(Merchand): Skip trade
break;
case "discord":
String link = DatabaseManager.getInstance().getConfig("discord-wh");
if(!link.equals("")){
DiscordWebhook discord = new DiscordWebhook(link);
discord.setContent("Item mis en vente pendant une heure: " + Merchand.current.x + " au prix de " + Merchand.current.y + TheVoidRoad.CoinGlyph);
try {
discord.execute();
} catch(Exception e){
e.printStackTrace();
}
}
break;
case "goto":
if(sender instanceof Player ply && m.getLocation() != null){

View File

@ -123,7 +123,13 @@ public class Merchand implements Listener{
String link = DatabaseManager.getInstance().getConfig("discord-wh");
if(!link.equals("")){
DiscordWebhook discord = new DiscordWebhook(link);
discord.setContent("Item mis en vente pendant une heure: " + current.x + " au prix de " + current.y + TheVoidRoad.CoinGlyph);
discord.setUsername(m.getName());
discord.setContent("Salut, Je vend actuellement `" + current.x + "` au prix de " + current.y + TheVoidRoad.CoinGlyph);
try {
discord.execute();
} catch(Exception ex){
ex.printStackTrace();
}
}
next = genTrade(e.unixhour + 1);
regenerate();