Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f6f7030d8c | |||
| a2576f961b | |||
| 844a9cd058 | |||
| 2a30fdf1e9 |
@@ -11,7 +11,7 @@ import * as cron from "node-cron";
|
|||||||
import timeNotice from "./scripts/timeNotice.js";
|
import timeNotice from "./scripts/timeNotice.js";
|
||||||
import { weatherNotice } from "./scripts/weatherNotice.js";
|
import { weatherNotice } from "./scripts/weatherNotice.js";
|
||||||
import earthquakeNotice from "./scripts/earthquakeNotice.js";
|
import earthquakeNotice from "./scripts/earthquakeNotice.js";
|
||||||
import Commands from "scripts/commands/main.js";
|
import Commands from "./scripts/commands/main.js";
|
||||||
|
|
||||||
// その他機能
|
// その他機能
|
||||||
import asciiArt from "./scripts/asciiart.js";
|
import asciiArt from "./scripts/asciiart.js";
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "notice-uwuzu",
|
"name": "notice-uwuzu",
|
||||||
"version": "v7.0(unconfirmed)@uwuzu1.5.4",
|
"version": "v7.1.1(LTS)@uwuzu1.5.4",
|
||||||
"description": "Notice Bot for uwuzu",
|
"description": "Notice Bot for uwuzu",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ueuse } from "types/types.js";
|
|||||||
import config from "../../config.js";
|
import config from "../../config.js";
|
||||||
|
|
||||||
export default async function Follow(data: ueuse) {
|
export default async function Follow(data: ueuse) {
|
||||||
const followReq = await fetch(`https://${config.uwuzu.host}/api/users/follow/`, {
|
const followReq = await fetch(`https://${config.uwuzu.host}/api/users/follow`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: config.uwuzu.apiToken,
|
token: config.uwuzu.apiToken,
|
||||||
@@ -15,7 +15,7 @@ export default async function Follow(data: ueuse) {
|
|||||||
console.log("フォロー: ", followRes);
|
console.log("フォロー: ", followRes);
|
||||||
|
|
||||||
|
|
||||||
const noticeReq = await fetch(`https://${config.uwuzu.host}/api/ueuse/create/`, {
|
const noticeReq = await fetch(`https://${config.uwuzu.host}/api/ueuse/create`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: config.uwuzu.apiToken,
|
token: config.uwuzu.apiToken,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ if (!fs.existsSync("logs/alreadyCommands.json")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 対応済みユーズ一覧
|
// 対応済みユーズ一覧
|
||||||
const alreadyCommands: Array<string> = JSON.parse(fs.readFileSync("alreadyCommands.json", "utf-8"));
|
const alreadyCommands: Array<string> = JSON.parse(fs.readFileSync("logs/alreadyCommands.json", "utf-8"));
|
||||||
|
|
||||||
function cutAfterChar(str: string, char: string) {
|
function cutAfterChar(str: string, char: string) {
|
||||||
const index = str.indexOf(char);
|
const index = str.indexOf(char);
|
||||||
@@ -57,14 +57,16 @@ function alreadyAdd(data: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function Commands() {
|
export default async function Commands() {
|
||||||
const mentions: Array<ueuse> = await (await fetch(
|
const mentionsReq = await fetch(
|
||||||
`https://${config.uwuzu.host}/api/ueuse/mentions/`, {
|
`https://${config.uwuzu.host}/api/ueuse/mentions`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: config.uwuzu.apiToken,
|
token: config.uwuzu.apiToken,
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
)).json();
|
);
|
||||||
|
|
||||||
|
const mentions: Array<ueuse> = await mentionsReq.json();
|
||||||
|
|
||||||
console.log("----------------");
|
console.log("----------------");
|
||||||
console.log("コマンド処理");
|
console.log("コマンド処理");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ueuse } from "types/types.js";
|
|||||||
import config from "../../config.js";
|
import config from "../../config.js";
|
||||||
|
|
||||||
export default async function UnFollow(data: ueuse) {
|
export default async function UnFollow(data: ueuse) {
|
||||||
const unfollowReq = await fetch(`https://${config.uwuzu.host}/api/users/unfollow/`, {
|
const unfollowReq = await fetch(`https://${config.uwuzu.host}/api/users/unfollow`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: config.uwuzu.apiToken,
|
token: config.uwuzu.apiToken,
|
||||||
@@ -14,7 +14,7 @@ export default async function UnFollow(data: ueuse) {
|
|||||||
|
|
||||||
console.log("フォロー解除: ", unfollowRes);
|
console.log("フォロー解除: ", unfollowRes);
|
||||||
|
|
||||||
const noticeReq = await fetch(`https://${config.uwuzu.host}/api/ueuse/create/`, {
|
const noticeReq = await fetch(`https://${config.uwuzu.host}/api/ueuse/create`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: config.uwuzu.apiToken,
|
token: config.uwuzu.apiToken,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { weatherReply } from "scripts/weatherNotice";
|
import { weatherReply } from "../weatherNotice.js";
|
||||||
import { ueuse } from "types/types.js";
|
import { ueuse } from "types/types.js";
|
||||||
|
|
||||||
export default function Weather(data: ueuse) {
|
export default function Weather(data: ueuse) {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import WebSocket from "ws";
|
|||||||
import sendMail from "../src/mailer.js";
|
import sendMail from "../src/mailer.js";
|
||||||
|
|
||||||
import config from "../config.js";
|
import config from "../config.js";
|
||||||
import { max } from "date-fns/fp";
|
|
||||||
|
|
||||||
class P2PEarthquakeClient {
|
class P2PEarthquakeClient {
|
||||||
private ws: WebSocket | null = null;
|
private ws: WebSocket | null = null;
|
||||||
@@ -476,8 +475,7 @@ async function event(earthquakeInfo: any): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function ueuse(text: string) {
|
async function ueuse(text: string) {
|
||||||
console.log(text);
|
const res = await fetch(`https://${config.uwuzu.host}/api/ueuse/create`, {
|
||||||
/*const res = await fetch(`https://${config.uwuzu.host}/api/ueuse/create/`, {
|
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
token: config.uwuzu.apiToken,
|
token: config.uwuzu.apiToken,
|
||||||
@@ -487,7 +485,7 @@ async function ueuse(text: string) {
|
|||||||
|
|
||||||
const resData = await res.json();
|
const resData = await res.json();
|
||||||
|
|
||||||
console.log(`地震情報投稿:${JSON.stringify(resData)}`);*/
|
console.log(`地震情報投稿:${JSON.stringify(resData)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function earthquakeNotice(): void {
|
export default function earthquakeNotice(): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user