Skip to content

Commit c6f1205

Browse files
Use vxtwitter's better brother (#60)
* feat: Use FixTweet instead of BetterTwitFix * fix: Don't let Prettier accidentally mess up our Keep-a-Changelog spec compliance
1 parent f63df01 commit c6f1205

8 files changed

Lines changed: 19 additions & 14 deletions

File tree

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGELOG.md

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.5.1 - 2022-11-29
9+
### Changed
10+
- Use the new-and-improved [FixTweet](https://github.com/FixTweet/FixTweet) instead of ye olde [BetterTwitFix](https://github.com/dylanpdx/BetterTwitFix).
11+
812
## 0.5.0 - 2022-10-13
913
### Added
1014
- We now join in on the server community by sharing reactions (mostly randomly). The default :star: emoji is ignored, in the interest of future features. :same: and :no_u: emoji are reciprocated 1 in 5 times, and every other emote is reciprocated 1 in 100 times.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Retrieves the most recent [xkcd](https://xkcd.com/) comic, or the given one.
156156

157157
### Fix Twitter Links
158158

159-
Transforms [twitter.com](https://twitter.com/) links in the given message to [vxtwitter.com](https://vxtwitter.com/) links in an ephemeral reply. Please use vxtwitter in your own messages, especially when the tweet is a video. Twitter's default embed stinks on some platforms.
159+
Transforms [twitter.com](https://twitter.com/) links in the given message to [FixTweet](https://github.com/FixTweet/FixTweet) links in an ephemeral reply. Please use fxtwitter in your own messages, especially when the tweet is a video. Twitter's default embed stinks on some platforms.
160160

161161
## Contributing
162162

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "csbot",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"description": "The One beneath the Supreme Overlord's rule. A bot to help manage the BYU CS Discord, successor to Ze Kaiser (https://github.com/arkenstorm/ze-kaiser)",
55
"private": true,
66
"scripts": {

src/commands/contextMenu/vxtwitter.test.ts renamed to src/commands/contextMenu/fxtwitter.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { vxtwitter } from './vxtwitter';
1+
import { fxtwitter } from './fxtwitter';
22

33
describe('Fix Twitter Links', () => {
44
const mockReplyPrivately = jest.fn();
@@ -26,22 +26,22 @@ describe('Fix Twitter Links', () => {
2626
async ({ content }: { content: string }) => {
2727
context.targetMessage.content = content;
2828

29-
await expect(vxtwitter.execute(context)).resolves.toBeUndefined();
29+
await expect(fxtwitter.execute(context)).resolves.toBeUndefined();
3030
expect(mockReplyPrivately).toHaveBeenCalledOnce();
3131
expect(mockReplyPrivately).toHaveBeenCalledWith(expect.stringContaining('no URLs found'));
3232
}
3333
);
3434

3535
test.each`
3636
content
37-
${'https://vxtwitter.com/example'}
37+
${'https://fxtwitter.com/example'}
3838
${'https://example.com'}
3939
`(
4040
'complains at the caller if none of the links in the message are Twitter links',
4141
async ({ content }: { content: string }) => {
4242
context.targetMessage.content = content;
4343

44-
await expect(vxtwitter.execute(context)).resolves.toBeUndefined();
44+
await expect(fxtwitter.execute(context)).resolves.toBeUndefined();
4545
expect(mockReplyPrivately).toHaveBeenCalledOnce();
4646
expect(mockReplyPrivately).toHaveBeenCalledWith(
4747
expect.stringContaining('no Twitter URLs found')
@@ -51,13 +51,13 @@ describe('Fix Twitter Links', () => {
5151

5252
test.each`
5353
content | result
54-
${'https://twitter.com/example'} | ${'https://vxtwitter.com/example'}
54+
${'https://twitter.com/example'} | ${'https://fxtwitter.com/example'}
5555
`(
5656
'sends an ephemeral message containing fixed versions of the Twitter links in the target',
5757
async ({ content, result }: { content: string; result: string }) => {
5858
context.targetMessage.content = content;
5959

60-
await expect(vxtwitter.execute(context)).resolves.toBeUndefined();
60+
await expect(fxtwitter.execute(context)).resolves.toBeUndefined();
6161
expect(mockReplyPrivately).toHaveBeenCalledOnce();
6262
expect(mockReplyPrivately).toHaveBeenCalledWith(expect.stringContaining(result));
6363
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ApplicationCommandType, ContextMenuCommandBuilder } from 'discord.js';
22
import { positionsOfUriInText } from '../../helpers/positionsOfUriInText';
33
import { URL } from 'node:url';
44

5-
export const vxtwitter: MessageContextMenuCommand = {
5+
export const fxtwitter: MessageContextMenuCommand = {
66
info: new ContextMenuCommandBuilder().setName('Fix Twitter Links'),
77
type: ApplicationCommandType.Message,
88
requiresGuild: false,
@@ -45,5 +45,5 @@ export const vxtwitter: MessageContextMenuCommand = {
4545
};
4646

4747
function vxTwitter(og: URL): URL {
48-
return new URL(og.pathname, 'https://vxtwitter.com');
48+
return new URL(og.pathname, 'https://fxtwitter.com');
4949
}

src/commands/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export function _add(cmd: Command): void {
3232
import { help } from './help';
3333
import { xkcd } from './xkcd';
3434
import { profile } from './profile';
35-
import { vxtwitter } from './contextMenu/vxtwitter';
35+
import { fxtwitter } from './contextMenu/fxtwitter';
3636
_add(help);
3737
_add(xkcd);
3838
_add(profile);
39-
_add(vxtwitter);
39+
_add(fxtwitter);

0 commit comments

Comments
 (0)