Skip to content

Commit f74a1e5

Browse files
committed
release: 0.1.0
1 parent a405b1b commit f74a1e5

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# v0.1.0 (2021-11-29)
2+
- Initial release
3+
- This version mostly supports message sending (with a few bugs)

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
11
# Termivolt
22

33
A simple utility to interact with the Revolt API via the command line.
4+
5+
## Installation
6+
7+
You can install Termivolt via the following methods:
8+
9+
### npm
10+
11+
`npm i -g termivolt`
12+
13+
### Yarn
14+
15+
`yarn global add termivolt`
16+
17+
Yarn 2+ [doesn't support global installs](https://github.com/yarnpkg/berry/issues/821), but you can run Termivolt as a "one-time" command with `yarn dlx`:
18+
19+
`yarn dlx termivolt <command, eg -help>`
20+
21+
(Note that you'll have to append `yarn dlx` every time you want to use Termivolt with this method.)
22+
23+
### pnpm
24+
25+
`pnpm add termivolt --global`
26+
27+
## Usage
28+
29+
Required arguments are in \<angle brackets>, while optional arguments are in [square brackets].
30+
31+
### Sending messages (-send)
32+
33+
To send messages with Termivolt, run `termivolt -send`. Here's the full list of arguments:
34+
35+
`termivolt -send <(--user/--bot)> <channel id (in quotes)> <message content (in quotes)>`
36+
37+
#### Arguments
38+
39+
- `--user/--bot` determines whether the token is a bot or session token. These require different methods of authenticating. Session tokens are currently broken - a fix will be released in the future.
40+
- The token is provided as-is (ie as copied from Revolt). Bot tokens can be found in your bot settings page - to get session tokens, [follow this guide](https://infi.sh/post/revolt-tokens).
41+
- The channel ID should be provided as a string (ie in quotes). You can find it in the URL when using Revite (the official Revolt client) or by right-clicking the channel's entry on the channel list and selecting "Copy channel ID".
42+
- The message itself should be fully encased in double quotes - if you want to use double quotes in the message itself, escape them with a backslash. Note that message formatting may be messed up in some cases - I'm still investigating as to why, but it seems backticks and \newlines break.
43+
44+
### Help (-help)
45+
46+
If you need help, or want to see a list of commands, run `termivolt -help`. This will also show you what version of Termivolt you're using, which is useful for bug reports and such.

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if (command) {
3030
const data = JSON.parse(await fs.readFile("package.json"));
3131

3232
// send help message
33-
console.log(`${chalk.bold.underline.blue(`Termivolt v${data.version}`)}\nTermivolt is a simple utility to interact with the Revolt API via the command line.\n\n${chalk.bold.underline("Commands:\n")}${chalk.bold("-send:")} Sends a message via the specified account.\n${chalk.underline("Example usage:")} termviolt -send <--user/--bot> <token> <channel> <message content (in quotes)>\n${chalk.underline("Notes:")} Formatting may be broken in some cases. In addition, sending via user accounts (using session tokens) currently seems to be broken - a fix will be released in the future.`);
33+
console.log(`${styles.title(`Termivolt v${data.version}`)}\nTermivolt is a simple utility to interact with the Revolt API via the command line.\n\n${styles.header("Commands:\n")}${chalk.bold("-send:")} Sends a message via the specified account.\n${chalk.underline("Example usage:")} termviolt -send <(--user/--bot)> <token> <channel> <message content (in quotes)>\n${chalk.underline("Notes:")} Formatting may be broken in some cases. In addition, sending via user accounts (using session tokens) currently seems to be broken - a fix will be released in the future.`);
3434
break;
3535
default:
3636
console.log(

src/lib/send.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const sendMsg = function (userType, token, channel, content) {
1616
return (
1717
console.log(
1818
styles.error(
19-
"You need to specify a token, a channel ID and the content of the message (all in quotes)."
19+
"You need to specify a token, a channel ID and the content of the message (the last two in quotes)."
2020
)
2121
) && process.exit()
2222
);

src/lib/styles.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ export default {
44
info: chalk.blue,
55
error: chalk.bold.red,
66
success: chalk.bold.green,
7+
8+
// -help styles
9+
title: chalk.bold.underline.blue,
10+
header: chalk.bold.underline
711
};

0 commit comments

Comments
 (0)