alias the second
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 18s
All checks were successful
fetch npm modules / f0ck the f0cker (push) Successful in 18s
This commit is contained in:
@ -211,6 +211,19 @@ export default async bot => {
|
||||
await fs.promises.copyFile(source, `./public/b/${filename}`);
|
||||
await fs.promises.unlink(source).catch(_=>{});
|
||||
|
||||
// user alias
|
||||
let username = e.user.nick || e.user.username;
|
||||
const alias = (await db`
|
||||
select "user"."user"
|
||||
from "user_alias"
|
||||
join "user" on "user".id = user_alias.userid
|
||||
where lower(user_alias.alias) ilike ${username}
|
||||
limit 1
|
||||
`)?.[0]?.user;
|
||||
if(alias) {
|
||||
username = alias;
|
||||
}
|
||||
|
||||
await db`
|
||||
insert into items ${
|
||||
db({
|
||||
@ -219,7 +232,7 @@ export default async bot => {
|
||||
mime: mime,
|
||||
size: size,
|
||||
checksum: checksum,
|
||||
username: e.user.nick || e.user.username,
|
||||
username: username,
|
||||
userchannel: e.channel,
|
||||
usernetwork: e.network,
|
||||
stamp: ~~(new Date() / 1000),
|
||||
|
Reference in New Issue
Block a user