Skip to content

Commit

Permalink
wip: to not impl
Browse files Browse the repository at this point in the history
  • Loading branch information
EdamAme-x committed Sep 9, 2024
1 parent 5b595b9 commit 0cc62a7
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 236 deletions.
2 changes: 2 additions & 0 deletions archive/method.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,13 @@ for value in mid:
`sqrd += [0, 0]`はメッセージの終了を意味します

つまり、

```py
param = [12,1,[
[8,1,0],
[11,2,to],
[14,3,[11,[mid]]]
]]
```

と変換できます
143 changes: 79 additions & 64 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,72 +1,87 @@
import { defineConfig } from 'vitepress'
import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "LINEJS Documentation",
titleTemplate: ":title | LINEJS",
description: "Documentation of LINEJS | LINEJS is a JavaScript library for LINE SelfBot.",
sitemap: {
hostname: 'https://linejs.evex.land',
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
siteTitle: 'LINEJS Docs',
search: {
provider: 'local'
},
title: "LINEJS Documentation",
titleTemplate: ":title | LINEJS",
description:
"Documentation of LINEJS | LINEJS is a JavaScript library for LINE SelfBot.",
sitemap: {
hostname: "https://linejs.evex.land",
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
siteTitle: "LINEJS Docs",
search: {
provider: "local",
},

nav: [
{ text: 'Home', link: '/' },
{ text: 'Docs', link: '/docs/start' },
{ text: 'Examples', link: 'https://github.com/evex-dev/linejs' }
],
nav: [
{ text: "Home", link: "/" },
{ text: "Docs", link: "/docs/start" },
{ text: "Examples", link: "https://github.com/evex-dev/linejs" },
],

sidebar: [
{
text: 'Docs',
items: [
{ text: 'Start', link: '/docs/start' },
{ text: 'Start 2', link: '/docs/start-2' },
{ text: 'Message Event', link: '/docs/message-event' },
]
},
{
text: 'Guides',
items: [
{ text: 'Authors', link: '/docs/authors' },
{ text: 'Question', link: '/docs/question' }
]
}
],
sidebar: [
{
text: "Docs",
items: [
{ text: "Start", link: "/docs/start" },
{ text: "Start 2", link: "/docs/start-2" },
{ text: "Message Event", link: "/docs/message-event" },
],
},
{
text: "Guides",
items: [
{ text: "Authors", link: "/docs/authors" },
{ text: "Question", link: "/docs/question" },
],
},
],

editLink: {
pattern: 'https://github.com/evex-dev/linejs/edit/main/docs/:path',
text: 'Edit this page on GitHub',
},
editLink: {
pattern: "https://github.com/evex-dev/linejs/edit/main/docs/:path",
text: "Edit this page on GitHub",
},

footer: {
message: 'Released under the MIT License.',
copyright:
'Copyright © '+ new Date().getFullYear() + '-present Evex Developers.',
},
footer: {
message: "Released under the MIT License.",
copyright: "Copyright © " + new Date().getFullYear() +
"-present Evex Developers.",
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/evex-dev/linejs' },
{ icon: 'discord', link: 'https://evex.land' }
]
},
head: [
['link', { rel: 'icon shortcut', href: '/favicon.png' }],
['link', { rel: 'apple-touch-icon', href: '/favicon.png' }],
['meta', { name: 'og:title', content: 'LINEJS Documentation' }],
['meta', { name: 'og:image', content: 'https://linejs.evex.land/favicon.png' }],
['meta', { name: 'og:description', content: 'LINEJS Documentation | LINEJS is a JavaScript library for LINE SelfBot.' }],
['meta', { name: 'og:url', content: 'https://linejs.evex.land' }],
['meta', { name: 'twitter:title', content: 'LINEJS Documentation' }],
['meta', { name: 'twitter:description', content: 'LINEJS Documentation | LINEJS is a JavaScript library for LINE SelfBot.' }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
['meta', { name: 'twitter:site', content: '@amex2189' }],
['meta', { name: 'twitter:creator', content: '@amex2189' }],
['meta', { name: 'twitter:image', content: 'https://linejs.evex.land/favicon.png' }],
],
})
socialLinks: [
{ icon: "github", link: "https://github.com/evex-dev/linejs" },
{ icon: "discord", link: "https://evex.land" },
],
},
head: [
["link", { rel: "icon shortcut", href: "/favicon.png" }],
["link", { rel: "apple-touch-icon", href: "/favicon.png" }],
["meta", { name: "og:title", content: "LINEJS Documentation" }],
["meta", {
name: "og:image",
content: "https://linejs.evex.land/favicon.png",
}],
["meta", {
name: "og:description",
content:
"LINEJS Documentation | LINEJS is a JavaScript library for LINE SelfBot.",
}],
["meta", { name: "og:url", content: "https://linejs.evex.land" }],
["meta", { name: "twitter:title", content: "LINEJS Documentation" }],
["meta", {
name: "twitter:description",
content:
"LINEJS Documentation | LINEJS is a JavaScript library for LINE SelfBot.",
}],
["meta", { name: "twitter:card", content: "summary_large_image" }],
["meta", { name: "twitter:site", content: "@amex2189" }],
["meta", { name: "twitter:creator", content: "@amex2189" }],
["meta", {
name: "twitter:image",
content: "https://linejs.evex.land/favicon.png",
}],
],
});
27 changes: 13 additions & 14 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'
import { h } from "vue";
import type { Theme } from "vitepress";
import DefaultTheme from "vitepress/theme";
import "./style.css";

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp({ app, router, siteData }) {

}
} satisfies Theme
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
});
},
enhanceApp({ app, router, siteData }) {
},
} satisfies Theme;
14 changes: 7 additions & 7 deletions docs/deno.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"tasks": {
"vp": "deno run -A npm:vitepress"
},
"unstable": [
"byonm"
]
}
"tasks": {
"vp": "deno run -A npm:vitepress"
},
"unstable": [
"byonm"
]
}
3 changes: 3 additions & 0 deletions docs/docs/authors.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Authors

Maintainers of **LINEJS**

## Maintainers

- Owner & Developer [Piloking](https://github.com/piloking)
- Developer [EdamAme-x](https://github.com/EdamAme-x)

## Sub-maintainers

- Developer [MocA-Love](https://github.com/MocA-Love)
- Developer [Hafusun](https://github.com/hafusun)
3 changes: 2 additions & 1 deletion docs/docs/message-event.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Receive Message Event
Coming soon...

Coming soon...
1 change: 1 addition & 0 deletions docs/docs/question.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Question

This is our server. Feel free to ask questions!

[https://discord.gg/evex](https://discord.gg/evex)
67 changes: 33 additions & 34 deletions docs/docs/start-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ client.on("pincall", (pincode) => {
client.on("ready", async (user) => {
console.log(`Logged in as ${user.displayName} (${user.mid})`);

console.log(await client.getProfile());
console.log(await client.getProfile());
});

await client.login({
Expand All @@ -39,24 +39,25 @@ The output will be as follows.
}
```

I will tell you one thing here.
When you log in, you can use a better choice.
I will tell you one thing here.\
When you log in, you can use a better choice.

Logging in repeatedly with *email* may be regarded as fraudulent login
and your account may be temporarily restricted (though only for a few days), and above all, It is very cumbersome.
Logging in repeatedly with _email_ may be regarded as fraudulent login\
and your account may be temporarily restricted (though only for a few days), and
above all, It is very cumbersome.

It is therefore a good idea to use an **AuthToken**.
It is therefore a good idea to use an **AuthToken**.

A temporary token is used for email login.
Therefore, after a few days, it will expire and the client will stop running.
A temporary token is used for email login.\
Therefore, after a few days, it will expire and the client will stop running.\
So, if you want to run the client permanently, you must use v1.

It would be a good idea to use v2 during development.
It would be a good idea to use v2 during development.\
Repeating the email login multiple times is highly discouraged.

Now, let's look at how to get token.

Simply write the following.
Simply write the following.\
It's easy.

```ts
Expand All @@ -71,51 +72,49 @@ The output will be as follows.
AuthToken **********.********
```

This is the v2 token.
It can be used as follows
This is the v2 token. It can be used as follows

```ts
await client.login({
authToken: "YOUR_AUTH_TOKEN",
});
```

However, this login method has pitfalls.
LINE uses *e2ee* for encryption, but the key to decrypt it can only be obtained with an email login.
However, this login method has pitfalls. LINE uses _e2ee_ for encryption, but
the key to decrypt it can only be obtained with an email login.

Therefore, if you login only with an authToken, you will not be able to retrieve group talk events.
Therefore, if you login only with an authToken, you will not be able to retrieve
group talk events.\
(Square (open chat) is possible.)

So how can we do this?  
It's easy, too.
So how can we do this?   It's easy, too.

We just need to make the internal storage permanent and log in with email first only once.
We just need to make the internal storage permanent and log in with email first
only once.

LINEJS has internal storage for storing and caching.
By default, it is `MemoryStorage`, and it all disappears after one execution.
LINEJS has internal storage for storing and caching.\
By default, it is `MemoryStorage`, and it all disappears after one execution.

This can be `FileStorage`.
As follows.
This can be `FileStorage`. As follows.

```ts
import { FileStorage } from "@evex/linejs/storage";

const client = new Client({
storage: new FileStorage("./storage.json"), // path to storage file (This is secret file)
})
storage: new FileStorage("./storage.json"), // path to storage file (This is secret file)
});
```

You only need to log in once first with your email and then use your authToken.
You only need to log in once first with your email and then use your authToken.

This concludes our first trip.
But there is still a journey left to be made.
This concludes our first trip.\
But there is still a journey left to be made.\
Enjoy.

:::info
If you want to create your own storage such as connecting to the cloud api,
import `BaseStorage` and extend it to create your own storage. (Please ask for details.)
:::
:::info If you want to create your own storage such as connecting to the cloud
api,\
import `BaseStorage` and extend it to create your own storage. (Please ask for
details.) :::

:::info
If you want to use v1, please ask for details at [discord.gg/evex](https://discord.gg/evex).
:::
:::info If you want to use v1, please ask for details at
[discord.gg/evex](https://discord.gg/evex). :::
Loading

0 comments on commit 0cc62a7

Please sign in to comment.