Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor change on documentation of Message and casing of the adapterName #1747

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export class Message {
// Represents an incoming message from the chat.
//
// user - A User instance that sent the message.
// done - A boolean indicating if the message has been handled.
constructor (user, done) {
this.user = user
this.done = done || false
Expand Down Expand Up @@ -50,15 +51,11 @@ export class TextMessage extends Message {
// Represents an incoming user entrance notification.
//
// user - A User instance for the user who entered.
// text - Always null.
// id - A String of the message ID.
export class EnterMessage extends Message {}

// Represents an incoming user exit notification.
//
// user - A User instance for the user who left.
// text - Always null.
// id - A String of the message ID.
export class LeaveMessage extends Message {}

// Represents an incoming topic change notification.
Expand All @@ -68,6 +65,10 @@ export class LeaveMessage extends Message {}
// id - A String of the message ID.
export class TopicMessage extends TextMessage {}

// Represents a catch all error message.
//
// user - A User instance that sent the message.
// message - A TextMessage with the message.
export class CatchAllMessage extends Message {
// Represents a message that no matchers matched.
//
Expand Down
4 changes: 2 additions & 2 deletions src/Robot.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class Robot {
this.brain = new Brain(this)
this.alias = alias
this.adapter = null
this.adaptername = 'Shell'
this.adapterName = 'Shell'
if (adapter && typeof (adapter) === 'object') {
this.adapter = adapter
this.adapterName = adapter.name ?? adapter.constructor.name
} else {
this.adapterName = adapter ?? this.adaptername
this.adapterName = adapter ?? this.adapterName
}

this.shouldEnableHttpd = httpd ?? true
Expand Down