-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed to Emote Cloner + added BetterTTV support
- Loading branch information
Showing
10 changed files
with
213 additions
and
59 deletions.
There are no files selected for viewing
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
# 7TV Importer | ||
**7TV Importer (Unofficial)** is a Discord bot that can import emotes from 7TV into Discord. | ||
# Twitch Cloner | ||
**Twitch Cloner** is a Discord bot that clones emotes from BetterTTV and 7TV into Discord. | ||
|
||
7TV Importer is **not affiliated** with 7TV. | ||
Twitch Cloner is **not affiliated** with Twitch, BetterTTV, FrankerFaceZ or 7TV. | ||
|
||
[Add 7TV Importer to your server](https://discord.com/api/oauth2/authorize?client_id=1163079809719611413&permissions=8799314249792&scope=bot) | ||
## 🔗 Links | ||
- [🤖 Invite Link](https://discord.com/api/oauth2/authorize?client_id=1163079809719611413&permissions=8799314249792&scope=bot) | ||
|
||
## Usage | ||
To add an emote, use the **/emote** command. | ||
## ✨ Features | ||
- Cloning any emote from [BetterTTV](https://betterttv.com). | ||
- Cloning any emote from [7TV](https://7tv.app). | ||
|
||
![/emote Usage example](./gh_assets/example1.gif) | ||
## ⚙️ Commands | ||
- 🔧 **/emote** - Clones any emote from BTTV/7TV. | ||
- 🔒 This command requires **Manage Expressions** permission. | ||
- ⚙️ Parameters: | ||
- 🔗 **url** (Required) - Emote URL (Supported platforms: BTTV, 7TV) | ||
- 🔼 **size** - Emote size - 1x, 2x, 4x (3x for BTTV) | ||
- 📝 **name** - Override default emote name | ||
- 🛑 **disable_animations** - If animated, emote will be uploaded as static image | ||
|
||
Command options: | ||
- url (Required) - Emote URL | ||
- size - Emote size (1x, 2x or 4x) | ||
- name - Overwrite emote name | ||
- disable_animations - If the emote is animated, it will be uploaded as non-animated image | ||
![/emote Usage example](.github/example1.gif) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
CLIENT_ID= | ||
TOKEN= | ||
TOKEN= | ||
|
||
DEV_MODE=false | ||
DEV_CLIENT_ID= | ||
DEV_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
{ | ||
"name": "7tv-importer", | ||
"version": "1.0.1", | ||
"description": "Discord bot that imports 7TV emotes.", | ||
"main": "index.js", | ||
"name": "emote-cloner", | ||
"version": "1.1.0", | ||
"description": "Discord bot that clones BTTV/7TV emotes.", | ||
"main": "dist/bot.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"dev": "ts-node-dev bot.ts", | ||
"start": "node dist/bot.js", | ||
"build": "tsc" | ||
}, | ||
"homepage": "https://github.com/mxgic1337/emote-cloner", | ||
"keywords": [], | ||
"author": "mxgic1337_", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/mxgic1337/emote-cloner/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mxgic1337/emote-cloner" | ||
}, | ||
"license": "GPL-3.0", | ||
"dependencies": { | ||
"discord.js": "^14.13.0", | ||
"dotenv": "^16.3.1" | ||
}, | ||
"devDependencies": { | ||
"ts-node-dev": "^2.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
|
||
export async function getEmoteDataFromURL(url: string) { | ||
return await getEmoteData(url.split('/')[4].split('/')[0]) | ||
} | ||
|
||
export async function getEmoteData(id: string) { | ||
const response = await fetch('https://api.betterttv.net/3/emotes/' + id) | ||
if (response.ok) { | ||
const emote = await response.json(); | ||
return { | ||
platform: 'bttv', | ||
name: emote.code, | ||
hostURL: 'https://cdn.betterttv.net/emote/'+emote.id+'/{{size}}', | ||
animated: emote.animated, | ||
author: { | ||
name: emote.user.displayName, | ||
avatar: 'https://pbs.twimg.com/profile_images/1615415316657364994/r3yTCKWx_400x400.jpg', | ||
} | ||
} as Emote | ||
}else{ | ||
const text = await response.text() | ||
console.error(text) | ||
return undefined | ||
} | ||
} | ||
|
||
export type Emote = { | ||
platform: 'bttv' | 'ffz' | '7tv', | ||
name: string, | ||
hostURL: string, | ||
animated: boolean, | ||
author: { | ||
name: string, | ||
avatar: string | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.