Official Guilded server: guilded.gg/Guilded4J-Cafe (or use this)
- Add G4J as dependency
- Start coding
import com.google.common.eventbus.Subscribe;
import vip.floatationdevice.guilded4j.G4JClient;
import vip.floatationdevice.guilded4j.event.ChatMessageCreatedEvent;
import vip.floatationdevice.guilded4j.object.ChatMessage;
public class Main {
final static G4JClient client = new G4JClient("YOUR TOKEN HERE");
@Subscribe
public void onMessage(ChatMessageCreatedEvent event) {
ChatMessage m = event.getChatMessage();
if(m.getContent().equals("ping")) { // if someone sends "ping"
client.getChatMessageManager() // use the client's chat message manager
.createChannelMessage( // send a chat message
m.getChannelId(), // send to the channel where "ping" belongs to
"pong" // send "pong"
);
}
}
public static void main(String[] args) {
client.registerEventListener(new Main());
client.connectWebSocket();
}
}
- Compile & have fun :)
- Development builds:
- Wiki page
- Javadoc
- Other example bots
- The Guilded bot API is still in early development. Don't request Guilded4J to add some functions that are not implemented on the Guilded side.
Chat & messaging
- Create message - createChannelMessage()
- Delete message - deleteChannelMessage()
- Update message - updateChannelMessage()
- Get message info - getChannelMessage()
- Get messages - getChannelMessages()
- Add reaction - addReaction()
- Remove reaction - removeReaction()
Calendar
- Create event - createCalendarEvent()
- Delete event - deleteCalendarEvent()
- Update event - updateCalendarEvent()
- Get event info - getCalendarEvent()
- Get events - getCalendarEvents()
- Create comment - createCalendarEventComment()
- Update comment - updateCalendarEventComment()
- Delete comment - deleteCalendarEventComment()
- Get comment info - getCalendarEventComment()
- Get comments - getCalendarEventComments()
- Create or update RSVP - updateCalendarEventRsvp()
- Get RSVPs - getCalendarEventRsvps()
- Delete RSVP - deleteCalendarEventRsvp()
- Get RSVP info - getCalendarEventRsvp()
Members
- Get user info - getUser()
- Update/delete nickname - setMemberNickname()
- Get member info - getServerMember()
- Kick server member - kickServerMember()
- Get member list - getServerMembers()
- Get member ban info - getServerMemberBan()
- Ban server member - banServerMember()
- Unban server member - unbanServerMember()
- Get member ban list - getServerMemberBans()
Forum
- Create forum topic - createForumTopic()
- Update forum topic - updateForumTopic()
- Delete forum topic - deleteForumTopic()
- Get forum topic info - getForumTopic()
- Get forum topic list - getForumTopics()
- Pin a forum topic - pinForumTopic()
- Unpin a forum topic - unpinForumTopic()
- Lock a forum topic - lockForumTopic()
- Unlock a forum topic - unlockForumTopic()
- Create a forum topic comment - createForumTopicComment()
- Update a forum topic comment - updateForumTopicComment()
- Delete a forum topic comment - deleteForumTopicComment()
- Get a comment on a forum topic - getForumTopicComment()
- Get a forum topic's comments - getForumTopicComments()
- Add reaction - addReaction()
- Remove reaction - removeReaction()
List
- Create list item - createListItem()
- Get list items - getListItems()
- Get a list item - getListItem()
- Update list item - updateListItem()
- Delete list item - deleteListItem()
- Completed list item - completeListItem()
- Uncomplted list item - uncompleteListItem()
Document
- Create document - createDoc()
- Update document - updateDoc()
- Delete document - deleteDoc()
- Get document info - getDoc()
- Get last 50 updated docs - getChannelDocs()
XP
- Add XP to user - awardUserXp()
- Add XP to all users with specified role - awardRoleXp()
- Set XP of user - setUserXp()
Social links
- Get member's social link - getSocialLink()
Group membership
- Add member to group - addGroupMember()
- Remove member from group - removeGroupMember()
Role membership
- Get member's role(s) - getMemberRoles()
- Assign role to member - addRoleMember()
- Remove role from member - removeRoleMember()
Webhooks
- Create webhook - createWebhook()
- Get webhooks - getWebhooks()
- Update webhook - updateWebhook()
- Delete webhook - deleteWebhook()
- Get webhook info - getWebhook()
Channels
- Create channel - createServerChannel()
- Update channel - updateServerChannel()
- Delete channel - deleteServerChannel()
- Get channel info - getServerChannel()
- Get channel list - getServerChannels()
Server
- Get server info - getServer()
Event
- BotServerMembershipCreatedEvent
- BotServerMembershipDeletedEvent
- CalendarEventCreatedEvent
- CalendarEventDeletedEvent
- CalendarEventCommentCreatedEvent
- CalendarEventCommentUpdatedEvent
- CalendarEventCommentDeletedEvent
- CalendarEventRsvpDeletedEvent
- CalendarEventRsvpManyUpdatedEvent
- CalendarEventRsvpUpdatedEvent
- CalendarEventUpdatedEvent
- ChannelMessageReactionCreatedEvent
- ChannelMessageReactionDeletedEvent
- ChatMessageCreatedEvent
- ChatMessageDeletedEvent
- ChatMessageUpdatedEvent
- DocCreatedEvent
- DocDeletedEvent
- DocUpdatedEvent
- ForumTopicCreatedEvent
- ForumTopicDeletedEvent
- ForumTopicUpdatedEvent
- ForumTopicCommentCreatedEvent
- ForumTopicCommentUpdatedEvent
- ForumTopicCommentDeletedEvent
- ForumTopicPinnedEvent
- ForumTopicUnpinnedEvent
- ForumTopicReactionCreatedEvent
- ForumTopicReactionDeletedEvent
- ForumTopicCommentReactionCreatedEvent
- ForumTopicCommentReactionDeletedEvent
- ForumTopicLockedEvent
- ForumTopicUnlockedEvent
- GuildedWebsocketClosedEvent
- GuildedWebsocketWelcomeEvent
- ListItemCompletedEvent
- ListItemCreatedEvent
- ListItemDeletedEvent
- ListItemUncompletedEvent
- ListItemUpdatedEvent
- ServerChannelCreatedEvent
- ServerChannelDeletedEvent
- ServerChannelUpdatedEvent
- ServerMemberBannedEvent
- ServerMemberJoinedEvent
- ServerMemberRemovedEvent
- ServerMemberUnbannedEvent
- ServerMemberUpdatedEvent
- ServerRolesUpdatedEvent
- ServerWebhookCreatedEvent
- ServerWebhookUpdatedEvent
- ServerXpAddedEvent