Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dmzoneill committed Oct 17, 2024
1 parent 9fef6c2 commit 35e2be5
Show file tree
Hide file tree
Showing 19 changed files with 828 additions and 856 deletions.
236 changes: 117 additions & 119 deletions strategies/Chan.js

Large diffs are not rendered by default.

324 changes: 159 additions & 165 deletions strategies/Chuck.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions strategies/ChuckJokes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const MessageStrategy = require('../MessageStrategy.js')
class ChuckJokes extends MessageStrategy {
static dummy = MessageStrategy.derived.add(this.name)

constructor() {
constructor () {
super('ChuckJokes', {
enabled: true
})
Expand All @@ -33,7 +33,7 @@ class ChuckJokes extends MessageStrategy {
]
}

provides() {
provides () {
ChuckJokes.self = this

return {
Expand All @@ -55,7 +55,7 @@ class ChuckJokes extends MessageStrategy {
return MessageStrategy.state.ChuckJokes.enabled
}
},
'chuck': {
chuck: {
test: function (message) {
return message.body.toLowerCase() === 'chuck'
},
Expand All @@ -71,7 +71,7 @@ class ChuckJokes extends MessageStrategy {
return MessageStrategy.state.ChuckJokes.enabled
}
},
'dojoke': {
dojoke: {
test: function (message) {
ChuckJokes.self.Setup(message)
return MessageStrategy.state.ChuckJokes.chats[message.chatId].enabled === true
Expand All @@ -98,7 +98,7 @@ class ChuckJokes extends MessageStrategy {
}
}

get_joke() {
get_joke () {
const joke = request('GET', 'https://api.chucknorris.io/jokes/random', {
headers: {
Accept: 'text/plain'
Expand All @@ -107,7 +107,7 @@ class ChuckJokes extends MessageStrategy {
return joke.getBody()
}

Setup(message) {
Setup (message) {
if (Object.keys(MessageStrategy.state.ChuckJokes).includes('chats') === false) {
MessageStrategy.state.ChuckJokes.chats = {}
}
Expand All @@ -118,22 +118,22 @@ class ChuckJokes extends MessageStrategy {
}
}

ChuckSTFU(message) {
ChuckSTFU (message) {
ChuckJokes.self.Setup(message)
MessageStrategy.typing(message)
MessageStrategy.client.sendText(message.from, 'Don\'t let anyone tell you you\'re not powerful. You\'re the most powerful woman i know')
MessageStrategy.state.ChuckJokes.chats[message.chatId].enabled = false
return true
}

Chuck(message) {
Chuck (message) {
MessageStrategy.typing(message)
MessageStrategy.client.sendText(message.from, 'Game on ;)')
MessageStrategy.state.ChuckJokes.chats[message.chatId].enabled = true
return true
}

DoJoke(message) {
DoJoke (message) {
ChuckJokes.self.chuck_keywords.forEach(async function (word) {
try {
if (message.body.toLowerCase().indexOf(word) > -1) {
Expand Down
Loading

0 comments on commit 35e2be5

Please sign in to comment.