.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { User, Event, Comment, Tag } = require('../model')
|
||||
const config = require('../../../config')
|
||||
const { SHARED_CONF } = require('../../../config')
|
||||
const Mastodon = require('mastodon-api')
|
||||
// const Sequelize = require('sequelize')
|
||||
// const Op = Sequelize.Op
|
||||
@@ -13,7 +13,7 @@ const botController = {
|
||||
bot: null,
|
||||
async initialize () {
|
||||
const settings = await settingsController.settings()
|
||||
if (!settings.mastodon_auth) return
|
||||
if (!settings.mastodon_auth || !settings.mastodon_auth.access_token) return
|
||||
const mastodon_auth = settings.mastodon_auth
|
||||
botController.bot = new Mastodon({
|
||||
access_token: mastodon_auth.access_token,
|
||||
@@ -46,7 +46,7 @@ const botController = {
|
||||
const { access_token, instance } = mastodon_auth
|
||||
const bot = new Mastodon({ access_token, api_url: `https://${instance}/api/v1/` })
|
||||
const status = `${event.title} @ ${event.place.name} ${moment(event.start_datetime).format('ddd, D MMMM HH:mm')} -
|
||||
${event.description.length > 200 ? event.description.substr(0, 200) + '...' : event.description} - ${event.tags.map(t => '#' + t.tag).join(' ')} ${config.baseurl}/event/${event.id}`
|
||||
${event.description.length > 200 ? event.description.substr(0, 200) + '...' : event.description} - ${event.tags.map(t => '#' + t.tag).join(' ')} ${SHARED_CONF.baseurl}/event/${event.id}`
|
||||
|
||||
let media
|
||||
if (event.image_path) {
|
||||
|
||||
Reference in New Issue
Block a user