Skip to content

Commit

Permalink
Merge pull request #8 from MindfulMinun/dev
Browse files Browse the repository at this point in the history
Release v3.1.1
  • Loading branch information
MindfulMinun committed Jan 16, 2020
2 parents 9bd4c2c + c4ff99f commit a71aa6b
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 19 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@
See https://semver.org/
-->

# [Release v3.1.1](https://github.com/MindfulMinun/discord-haruka/releases/tag/v3.1.1)

- Pokémon
- Occasionally, searches with the "0" character would return unexpected results. This has now been fixed.
- Dab
- Dab now catches more variations on the word "dab"
- GitHub
- User Agent changed to something meaninful
- Smash
- Add Byleth to Smash

-----

# Development version v3.1.1

- Change GitHub UA to something meaningful
- Add Byleth to Smash

-----

# [Release v3.1.0](https://github.com/MindfulMinun/discord-haruka/releases/tag/v3.1.0)

- New: Edits
Expand Down
2 changes: 1 addition & 1 deletion coffeelint.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"max_line_length": {
"name": "max_line_length",
"value": 80,
"value": 120,
"level": "warn",
"limitComments": true
},
Expand Down
2 changes: 1 addition & 1 deletion dist/functions/github.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/functions/pkmn.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/functions/smash.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions dist/specials/dab.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions dist/specials/dad.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-haruka",
"version": "3.1.0",
"version": "3.1.1",
"description": "A useless Discord bot.",
"main": "dist/Haruka.js",
"repository": "github:MindfulMinun/discord-haruka",
Expand Down
2 changes: 1 addition & 1 deletion src/functions/github.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ handler = (msg, match, H) ->
url: "https://api.github.com/repos/" + repo
method: "GET"
headers: {
"User-Agent": "Node.js #{process.version} on Ubuntu 16.04"
"User-Agent": require('../package.json').repository
"Content-Type": "application/json"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/functions/pkmn.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ handler = (msg, match, Haruka) ->
you forgot this command’s syntax."
].choose()
[P, species, pkmn] = [{}, null, null]
pokeRequest = pokeRequest.replace(/0/g, '')
pokeRequest = pokeRequest.replace(/^\s*0/g, '')

#! Fetch pkmn
r "https://pokeapi.co/api/v2/pokemon-species/#{pokeRequest}/"
Expand Down
1 change: 1 addition & 0 deletions src/functions/smash.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ fNameMap = [
"Hero"
"Banjo & Kazooie"
"Terry"
"Byleth"
]

root = 'https://www.smashbros.com/assets_v2'
Expand Down
4 changes: 3 additions & 1 deletion src/specials/dab.coffee
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#! ========================================
#! Dab

dabRegex = /\bd+a+b+(ing|er|ino|[yi])*\b/gi
handler = (msg, Haruka) ->
# React with the dabbing emote every time some1 says
# "dab" or "dabbing" in any server

# If a message contains "dab" or "dabbing",
# react with the :rin_dab: emote if it exists
if /\b(dab(b?ing)?)\b/gi.test msg.content

if dabRegex.test msg.content
rin_dab = msg.guild.emojis.find((e) -> e.name is 'rin_dab')
if rin_dab? then msg.react rin_dab
return no
Expand Down
7 changes: 4 additions & 3 deletions src/specials/dad.coffee
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#! ========================================
#! Special: Dad

imRegex = /^(?:i(?:['’]|(?:\s+a))?m)\s+/i

handler = (msg, Haruka) ->

reg = /^(?:i(?:['’]|(?:\s+a))?m)\s+/i
# Matches "im ", "i'm ", "i’m ", and "i am "
# Case insensitive, whitespace required.

# Break if regex doesn't match.
if (not reg.test(msg.content)) or msg.author.bot then return no
if (not imRegex.test(msg.content)) or msg.author.bot then return no

# If the person's fortunate enough to get a number higher than
# 1 / 10, they’re spared.
Expand All @@ -20,7 +21,7 @@ handler = (msg, Haruka) ->
"Hey #{reply}, I’m Haruka."
"Hi #{reply}, I’m Haruka."
"Hello #{reply}, I’m Haruka. Nice to meet you."
].choose()
].choose(), disableEveryone: yes

# Message doesn't call Haruka, exit prematurely
yes
Expand Down

0 comments on commit a71aa6b

Please sign in to comment.