JDA 5: Discord Bot Tutorial - Events (#3)

JDA 5: Discord Bot Tutorial - Events (#3)

TechnoVision

1 год назад

10,642 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

David Joo
David Joo - 18.05.2023 07:07

@Override
public void onMessageReceived(MessageReceivedEvent event) {
String message = event.getMessage().getContentRaw();

if (message.contains("ping")) {
event.getChannel().sendMessage("pong").queue();
}
}

This part didn't work for me. Did anyone figure this out? I've tried to change the version that this guy used but still didn't work.

Ответить
SonderLa
SonderLa - 01.04.2023 13:45

Hey! How can I make the code to also say who removed the reactions?
Please help out:)

Ответить
Mahbus
Mahbus - 15.03.2023 12:02

mine sendMessage is red

Ответить
BadBronx99
BadBronx99 - 06.02.2023 03:08

I get a error when I try to do the event.getGuild.getDefaultChannel it wont let me put in sendmessage

Ответить
Asura
Asura - 23.01.2023 09:20

If your code isn’t working for the events it might be because of the new gateway intents

Ответить
Ahmet Kılıç
Ahmet Kılıç - 27.12.2022 13:37

it gives this error String emoji = event.getreaction().getReactionEmote.getAsReactionCode() why?

Ответить
Just Brandon
Just Brandon - 19.12.2022 08:30

If you say something like PiNg then it wont say pong, but when I use .toLowerCase() the bot non stop spams messages into the chat. why does this happen?

Ответить
Kuro
Kuro - 19.10.2022 17:09

getContentDisplay() just doesn't seem to work. I have tried everything I could imagine but for some reason he does not get the content of the message. he realises that there is a message and where it is but not the content of it.

Ответить
Walker McGilvary
Walker McGilvary - 22.09.2022 00:36

thank you for these videos👍

Ответить
TheDaddylongshaft
TheDaddylongshaft - 24.08.2022 05:18

Getting an override error when trying to have two overriden methods in the same class despite there method signatures being the same, anyone having this issue with the "onMessageRecieved" example?

Ответить
YoureAHotFishy
YoureAHotFishy - 18.08.2022 03:12

If you are getting an error when doing the "event.getGuild().getDefaultChannel().senMessage(message).queue();" It seemed to work for me when I did "event.getGuild().getDefaultChannel().asStandardGuildMessageChannel().sendMessage(message).queue();"

Ответить
robotical
robotical - 27.07.2022 22:08

im having an issue where when i get the message content like ```String message = event.getMessage().getContentRaw();``` the content is always noting
edit: nevermind that was just an issue with alpha.17 version i switched to alpha.12 and it works fine now :)

Ответить
The Fire Mouse
The Fire Mouse - 21.06.2022 02:19

Why does my bot send "this guy used this reaction" messages in the rules?
Edit: What is a "default channel" and why would the rules be it?

Ответить