-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from MSD-Incorporated/recode
A little recode
- Loading branch information
Showing
13 changed files
with
74 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Context, NextFunction } from "grammy"; | ||
import { Database } from "../structures/database"; | ||
|
||
export const autoCaching = async (ctx: Context & { database: Database }, database: Database, next: NextFunction) => { | ||
ctx.database = database; | ||
await next(); | ||
|
||
const user = ctx.from; | ||
if (!user || user.is_bot || user.id == 777000) return await next(); | ||
|
||
const dbuser = await database.resolveUser(user!, true); | ||
|
||
if ( | ||
user?.first_name !== dbuser?.first_name || | ||
user?.last_name !== dbuser?.last_name || | ||
user?.username !== dbuser?.username | ||
) { | ||
await database.updateUser(user!, { | ||
first_name: user?.first_name, | ||
last_name: user?.last_name, | ||
username: user?.username, | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
export * from "./autocaching"; | ||
|
||
export * from "./dick.composer"; | ||
export * from "./githubLink.composer"; | ||
export * from "./msdincorporated.composer"; | ||
export * from "./randomEmoji.compose"; | ||
export * from "./randomShit.composer"; | ||
export * from "./telegraph.composer"; | ||
|
||
export * from "./eval.command"; | ||
export * from "./exec.command"; | ||
export * from "./start.command"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Composer } from "grammy"; | ||
|
||
export const randomShitComposer = new Composer(); | ||
|
||
randomShitComposer.on("message:text", async (ctx, next) => { | ||
await next(); | ||
|
||
if (ctx.message.from.is_bot) return; | ||
if (Math.random() < 0.01) return ctx.react("👀"); | ||
}); | ||
|
||
randomShitComposer.on("::mention", ctx => { | ||
if (ctx.message?.text == `@${ctx.me.username}`) return ctx.reply("Я тут!"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
import { config } from "dotenv"; | ||
import { resolve } from "path"; | ||
import { Client } from "./structures/client"; | ||
|
||
config({ path: resolve(process.cwd(), ".env") }); | ||
const client = new Client(); | ||
|
||
client.init(); | ||
new Client().init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters