Skip to content

Instantly share code, notes, and snippets.

@samogot
samogot / search.plugin.js
Last active May 25, 2017 13:36 — forked from megamit/search.plugin.js
Last Update: 1. correct loading messages up and down without extra scrolling. 2. handle end of messages list - stop if nothing was found and cycle retry from begining (end) if something was. 3. search in full message (links, bold, cursive, any other tags except code and mentions if it isn't selected). 4. cool scrolling handle. if message visible…
//META{"name":"searchPlugin"}*//
class searchPlugin{
constructor(){
this.cancelFlag = false;
this.css = "<style class='searchBarPlugin'>"+
"#searchBarInner{"+
"float:right; position:relative; height: 40px; bottom:40px;color:#FFF; padding: 0 4px; border-radius: 4px;"+
'}'+
'.buttonClose{'+
'background: transparent url(https://discordapp.com/assets/14f734d6803726c94b970c3ed80c0864.svg); background-size: cover; transition: opacity .1s easeout; opacity: .5; width:12px; height: 12px; padding: 0'+
@samogot
samogot / count-unread.plugin.js
Last active July 11, 2022 16:20
Button for counting unread messages
//META{"name":"CountUnread"}*//
var CountUnread = function () {};
CountUnread.prototype.getName = function() {
return "CountUnread";
};
CountUnread.prototype.getDescription = function() {
return "Button for counting unread messages";
};
@samogot
samogot / readme.txt
Last active July 11, 2022 16:20
Button for returning to previous scroll position after posting a message
How to use:
I asume you have a channel with lot of unread messages. You are reading it all. You want to reply one of the messages.
But if you'd send message all unread messages will be marked as read. Moreover your scrolling position will be lost. Now this problem is gone!
1. Scroll wherever you whant. This scrolling position will be remembered
2. Send a message
3. There will appear a blue line with right and left buttons.
4. If you don't want to renurn srcolling position - click right side ("Cancel")
5. If you want to renurn srcolling position - click left side ("Return to last scrolling position")
If your scrolling position was within 50 messages - you will be scrolled immediately.
Otherwise plugin will start recursively load old messages find you scrolling position
@samogot
samogot / readme.txt
Last active July 11, 2022 16:20
Reply to people with a button, quouting full message or selected text
There is new version of quoter plugin! See here: https://github.com/samogot/betterdiscord-plugins/tree/master/v2/Quoter
If you neen Quoter 2.8 - look into gist's history.
How to use:
There is Quote button appears on message hover. It doesn't work in compact mode.
- Click Quote button to quote full messages group.