Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

HOWTO

Table of Contents

Downloads

BetterDiscord

Plugin (upstream): https://magane.moe/

Plugin (dev): https://gist.github.com/BobbyWibowo/a71a24cb907793be8af56dc52e016720

Plugin (dev-github): https://gist.github.com/BobbyWibowo/3743ad4c2122c52beb0f86bffb1d1c0f

Install it the same way you install any other BetterDiscord plugins.

dev version may come with faster updates/fixes to the custom packs feature, but they usually haven't gone through Pitu's/Kana's reviews (Magane's creator).

dev vs dev-github: the former is the version built in my own machine and hosted in my own server, the latter is built and hosted at github, BobbyWibowo/Magane. The former tends to be more experimental than the latter.

Console functions

Magane now have some functions that can be executed from the Console (Ctrl+Shift+I in Discord app):

magane.appendPack(title, firstid, count, animated)

Use this to add packs from the LINE web store (in case you don't want to bother Pitu/Kana 👀).

This was inspired by bd-linestickers plugin, and was originally done in harjitmoe's fork. I only expanded upon the functionality (e.g. animated stickers support), so props to those folks!

Unfortunately Discord recently stopped animating APNG (Animated PNG) in chat, which is the format LINE uses for their animated stickers.
And thus animated stickers added with this method will not be animated.
So if you really need those animated stickers, you will have to request Pitu/Kana to add them to Magane (since they will be converted to GIFs).
Optionally, you can try the more advanced method of making custom packs, but it can be more effort than worth.

Here's an example of a command to add Mickey Mouse: Lovely Smile pack (https://store.line.me/stickershop/product/1917/en):

magane.appendPack(`Mickey Mouse: Lovely Smile`, 37788, 40, false) 

What you need to pay attention to here are firstid, which is 37788, AND count, which is40.

firstid is the ID of the first sticker in the pack.
To get this ID, you would have to use your browser's Inspect Element feature on the first sticker.

Screenshot

With it, you should see something like this (don't worry if some strings aren't the exact same):

Screenshot

Look at the line that says https://stickershop.line-scdn.net/stickershop/v1/sticker/..., the ID is the numbers right afterwards, which is 37788.

Screenshot

As for count, it's the count of how many stickers there are in the pack.
For this you would have to count them manually, or you can choose to run this one-liner script in your browser's Console:

document.querySelectorAll('.mdCMN09Li').length

The said pack should have 40 stickers.

Screenshot

So after running the said command in your Discord app's Console, you should see something like this:

Screenshot

After adding a pack, you still need to subscribe to it from the subscription menu to start using them:

Screenshot

Too complicated?

You can try using this userscript instead: https://greasyfork.org/en/scripts/373429-line-append-string/code.
However you'd need a browser extension that lets you install userscripts, such as Tampermonkey, Greasemonkey, etc.

With it, you will be able to see something like this on every sticker pages:

Screenshot

Then you can simply run the line after Console command: in your Discord's console, and you're almost done! (don't forget you still need to subscribe to the pack from the subscription menu)

magane.appendCustomPack(title, id, count, animated, template)

This one is for the more advanced users.

You can use this to add your own custom packs that are hosted anywhere else, as long as the stickers can be hotlinked.

An example to add one of my custom packs, Azur Lane Pixel Stickers:

magane.appendCustomPack('Azur Lane Pixel Stickers', 'k9HCOlIRkV', 15, true, 'https://i.fiery.me/stickers/%pack%/%id%')

What you need to pay attention to here are id, which is k9HCOlIRkV, then count, which is 15, AND finally template, which is https://i.fiery.me/stickers/%pack%/%id%.

Template is the template URL to where the stickers can be downloaded.
Magane will replace %pack% with the ID (k9HCOlIRkV), and %id% with the individual sticker's IDs + extension name.
Magane expects the individual sticker IDs to be 1, 2, ..., n, a regular one-based index.

The extension name needs to be .png if not animated, OR .gif if otherwise.
In the example above, I have it as true because the pack is indeed animated.
Custom packs cannot mix extension names, so a pack can only be either fully animated OR not.

So for the example above, Magane expects the stickers to be hosted at https://i.fiery.me/stickers/k9HCOlIRkV/, and the individual stickers are named as 1.gif, 2.gif, ..., 15.gif.

Don't forget that after adding a pack, you still need to subscribe to it from the subscriptions menu to start using them.

magane.deletePack(id)

This is used to delete custom packs.

Now there's another thing that you need to pay attention to!

For packs that you added with magane.appendPack(), their internal IDs are startswith-<firstid>, where <firstid> is the ID of the first sticker in the pack.
So for the example Mickey Mouse pack, its ID would be startswith-37788.

For packs that you added with magane.appendCustomPack(), their internal IDs are custom-<id>, where <id> is the ID you initially input in the function.
So for the example Azur Lane Pixel Stickers pack, its ID would be custom-k9HCOlIRkV.

So for example, when you want to delete the Mickey Mouse pack, you'd run:

magane.deletePack('startswith-37788')

magane.searchPacks(keyword)

This is a helper function to search for added packs.

It will return their internal data structure, such as their internal ID, the stickers' file names, etc.

keyword is the search keyword, and needs to be a string.

So for example, to search for the Mickey Mouse pack, you can do any of these:

magane.searchPacks('mouse')
// or
magane.searchPacks('mickey mouse')
// or
magane.searchPacks('lovely') // remember, the pack's name is "Mickey Mouse: Lovely Smile"

Bonus: Custom packs

Here is my collection of custom packs: https://gist.github.com/BobbyWibowo/666f45d386594df0c4f58edce367d67b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment