Skip to content

Commit

Permalink
Minor change on documentation of Message and casing of the adapterName (
Browse files Browse the repository at this point in the history
#1747)

* Fix documentation on types.

* Fix casing of the adaptername => adapterName.

* fix: documentation of Message and casing of bot.adapterName
  • Loading branch information
KeesCBakker authored Nov 21, 2024
1 parent 183166a commit 9c2ca31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
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

0 comments on commit 9c2ca31

Please sign in to comment.